mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
style: format code for all
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<iframe
|
||||
:src="url"
|
||||
frameborder="0"
|
||||
class="iframe"
|
||||
></iframe>
|
||||
<iframe :src="url" frameborder="0" class="iframe"></iframe>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
import { ref } from 'vue';
|
||||
<script lang="ts">
|
||||
import { ref } from "vue";
|
||||
export default {
|
||||
setup() {
|
||||
const url = ref(process.env.NODE_ENV === 'production' ? '/manages/html/button.html' : '/html/button.html');
|
||||
const url = ref(
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/manages/html/button.html"
|
||||
: "/html/button.html"
|
||||
);
|
||||
return {
|
||||
url
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ import { defineComponent } from "vue";
|
||||
|
||||
import {
|
||||
directive,
|
||||
version,
|
||||
Contextmenu,
|
||||
ContextmenuItem,
|
||||
ContextmenuDivider,
|
||||
@@ -72,4 +71,4 @@ export default defineComponent({
|
||||
border-radius: 8px;
|
||||
background-color: rgba(90, 167, 164, 0.2);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="margin:10px">
|
||||
<div style="margin: 10px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="10">
|
||||
<!-- 基本使用 -->
|
||||
|
||||
@@ -7,22 +7,38 @@
|
||||
|
||||
<v-contextmenu ref="contextmenu">
|
||||
<v-contextmenu-group title="操作">
|
||||
<v-contextmenu-item :hide-on-click="false" @click="extra.push('item')">添加菜单</v-contextmenu-item>
|
||||
<v-contextmenu-item :hide-on-click="false" @click="extra.push('group')">添加菜单组</v-contextmenu-item>
|
||||
<v-contextmenu-item :hide-on-click="false" @click="extra.push('submenu')">添加子菜单</v-contextmenu-item>
|
||||
<v-contextmenu-item :hide-on-click="false" @click="extra.pop()">删除</v-contextmenu-item>
|
||||
<v-contextmenu-item :hide-on-click="false" @click="extra.push('item')"
|
||||
>添加菜单</v-contextmenu-item
|
||||
>
|
||||
<v-contextmenu-item :hide-on-click="false" @click="extra.push('group')"
|
||||
>添加菜单组</v-contextmenu-item
|
||||
>
|
||||
<v-contextmenu-item
|
||||
:hide-on-click="false"
|
||||
@click="extra.push('submenu')"
|
||||
>添加子菜单</v-contextmenu-item
|
||||
>
|
||||
<v-contextmenu-item :hide-on-click="false" @click="extra.pop()"
|
||||
>删除</v-contextmenu-item
|
||||
>
|
||||
</v-contextmenu-group>
|
||||
|
||||
<template v-for="(item, index) of extra">
|
||||
<template v-for="(item, index) of extra" :key="index">
|
||||
<v-contextmenu-divider />
|
||||
|
||||
<v-contextmenu-group v-if="item === 'group'" :title="`菜单组 ${index + 1}`">
|
||||
<v-contextmenu-group
|
||||
v-if="item === 'group'"
|
||||
:title="`菜单组 ${index + 1}`"
|
||||
>
|
||||
<v-contextmenu-item>菜单1</v-contextmenu-item>
|
||||
<v-contextmenu-item>菜单2</v-contextmenu-item>
|
||||
<v-contextmenu-item>菜单3</v-contextmenu-item>
|
||||
</v-contextmenu-group>
|
||||
|
||||
<v-contextmenu-submenu v-else-if="item === 'submenu'" :title="`子菜单 ${index + 1}`">
|
||||
<v-contextmenu-submenu
|
||||
v-else-if="item === 'submenu'"
|
||||
:title="`子菜单 ${index + 1}`"
|
||||
>
|
||||
<v-contextmenu-item>菜单1</v-contextmenu-item>
|
||||
<v-contextmenu-item>菜单2</v-contextmenu-item>
|
||||
<v-contextmenu-item>菜单3</v-contextmenu-item>
|
||||
@@ -39,7 +55,6 @@ import { defineComponent } from "vue";
|
||||
|
||||
import {
|
||||
directive,
|
||||
version,
|
||||
Contextmenu,
|
||||
ContextmenuItem,
|
||||
ContextmenuDivider,
|
||||
@@ -91,4 +106,4 @@ export default defineComponent({
|
||||
border-radius: 8px;
|
||||
background-color: rgba(90, 167, 164, 0.2);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -31,7 +31,6 @@ import { defineComponent } from "vue";
|
||||
|
||||
import {
|
||||
directive,
|
||||
version,
|
||||
Contextmenu,
|
||||
ContextmenuItem,
|
||||
ContextmenuDivider,
|
||||
@@ -69,4 +68,4 @@ export default ExampleSFC;
|
||||
border-radius: 8px;
|
||||
background-color: rgba(90, 167, 164, 0.2);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="margin:10px">
|
||||
<div style="margin: 10px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
|
||||
<el-card shadow="always">
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import CountTo from "/@/components/ReCountTo";
|
||||
export default {
|
||||
components: {
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
forceFallback="true"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
<div :class="'item'+' '+ 'item-' + element.num">{{ element.num }}</div>
|
||||
<div :class="'item' + ' ' + 'item-' + element.num">
|
||||
{{ element.num }}
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
</el-card>
|
||||
@@ -41,7 +43,7 @@
|
||||
animation="300"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<div class="item-single">{{element.name}} {{ index }}</div>
|
||||
<div class="item-single">{{ element.name }} {{ index }}</div>
|
||||
</template>
|
||||
</draggable>
|
||||
</el-card>
|
||||
@@ -56,7 +58,11 @@
|
||||
</template>
|
||||
<!-- 拖拽实现元素位置切换 -->
|
||||
<div class="cut-container">
|
||||
<div class="item-cut" v-for="(item,index) in cutLists" :key="index">
|
||||
<div
|
||||
class="item-cut"
|
||||
v-for="(item, index) in cutLists"
|
||||
:key="index"
|
||||
>
|
||||
<p>{{ item.name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,7 +72,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import draggable from "vuedraggable/src/vuedraggable";
|
||||
import { reactive, toRefs, onMounted } from "vue";
|
||||
export default {
|
||||
@@ -105,6 +111,7 @@ export default {
|
||||
onMounted(() => {
|
||||
// 使用原生sortable实现元素位置切换
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line no-undef
|
||||
new Sortable(document.querySelector(".cut-container"), {
|
||||
swap: true,
|
||||
forceFallback: true,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import { Amap } from "/@/components/ReMap";
|
||||
export default {
|
||||
components: {
|
||||
|
||||
@@ -5,20 +5,51 @@
|
||||
<div class="card-header">
|
||||
<span>无缝滚动示例</span>
|
||||
<el-button class="button" type="text" @click="changeDirection('top')">
|
||||
<span :style="{color: classOption.direction === 'top' ? 'red' : ''}">向上滚动</span>
|
||||
<span
|
||||
:style="{ color: classOption.direction === 'top' ? 'red' : '' }"
|
||||
>向上滚动</span
|
||||
>
|
||||
</el-button>
|
||||
<el-button class="button" type="text" @click="changeDirection('bottom')">
|
||||
<span :style="{color: classOption.direction === 'bottom' ? 'red' : ''}">向下滚动</span>
|
||||
<el-button
|
||||
class="button"
|
||||
type="text"
|
||||
@click="changeDirection('bottom')"
|
||||
>
|
||||
<span
|
||||
:style="{
|
||||
color: classOption.direction === 'bottom' ? 'red' : ''
|
||||
}"
|
||||
>向下滚动</span
|
||||
>
|
||||
</el-button>
|
||||
<el-button class="button" type="text" @click="changeDirection('left')">
|
||||
<span :style="{color: classOption.direction === 'left' ? 'red' : ''}">向左滚动</span>
|
||||
<el-button
|
||||
class="button"
|
||||
type="text"
|
||||
@click="changeDirection('left')"
|
||||
>
|
||||
<span
|
||||
:style="{ color: classOption.direction === 'left' ? 'red' : '' }"
|
||||
>向左滚动</span
|
||||
>
|
||||
</el-button>
|
||||
<el-button class="button" type="text" @click="changeDirection('right')">
|
||||
<span :style="{color: classOption.direction === 'right' ? 'red' : ''}">向右滚动</span>
|
||||
<el-button
|
||||
class="button"
|
||||
type="text"
|
||||
@click="changeDirection('right')"
|
||||
>
|
||||
<span
|
||||
:style="{ color: classOption.direction === 'right' ? 'red' : '' }"
|
||||
>向右滚动</span
|
||||
>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<SeamlessScroll ref="scroll" :data="listData" :class-option="classOption" class="warp">
|
||||
<SeamlessScroll
|
||||
ref="scroll"
|
||||
:data="listData"
|
||||
:class-option="classOption"
|
||||
class="warp"
|
||||
>
|
||||
<ul class="item">
|
||||
<li v-for="(item, index) in listData" :key="index">
|
||||
<span class="title" v-text="item.title"></span>
|
||||
@@ -29,7 +60,7 @@
|
||||
</el-space>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import { ref, unref } from "vue";
|
||||
import { templateRef } from "@vueuse/core";
|
||||
|
||||
@@ -39,6 +70,7 @@ export default {
|
||||
SeamlessScroll
|
||||
},
|
||||
setup() {
|
||||
// eslint-disable-next-line no-undef
|
||||
const scroll = templateRef<ElRef | null>("scroll", null);
|
||||
|
||||
let listData = ref([
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="box-card" style="margin:10px" v-for="(item,key) in dataLists" :key="key">
|
||||
<el-card
|
||||
class="box-card"
|
||||
style="margin: 10px"
|
||||
v-for="(item, key) in dataLists"
|
||||
:key="key"
|
||||
>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>{{item.title}}</span>
|
||||
<span>{{ item.title }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<Selector
|
||||
@@ -17,7 +22,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Selector from "/@/components/ReSelector";
|
||||
|
||||
@@ -38,7 +43,7 @@ export default {
|
||||
}
|
||||
]);
|
||||
|
||||
const selectedVal = ({ left, right, whole }) => {
|
||||
const selectedVal = ({ left, right }) => {
|
||||
selectRange.value = `${left}-${right}`;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,32 +2,31 @@
|
||||
<div id="mse"></div>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import Player from "xgplayer/dist/simple_player";
|
||||
import volume from 'xgplayer/dist/controls/volume';
|
||||
import playbackRate from 'xgplayer/dist/controls/playbackRate';
|
||||
import screenShot from 'xgplayer/dist/controls/screenShot';
|
||||
import { deviceDetection } from "/@/utils/deviceDetection"
|
||||
import volume from "xgplayer/dist/controls/volume";
|
||||
import playbackRate from "xgplayer/dist/controls/playbackRate";
|
||||
import screenShot from "xgplayer/dist/controls/screenShot";
|
||||
import { deviceDetection } from "/@/utils/deviceDetection";
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
let player = new Player({
|
||||
new Player({
|
||||
id: "mse",
|
||||
autoplay: false,
|
||||
screenShot: true,
|
||||
url:
|
||||
"https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-720p.mp4",
|
||||
url: "https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-720p.mp4",
|
||||
poster:
|
||||
"https://s2.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/poster.jpg",
|
||||
fluid: deviceDetection() ? true : false,
|
||||
fluid: deviceDetection(),
|
||||
controlPlugins: [volume, playbackRate, screenShot],
|
||||
playbackRate: [0.5, 0.75, 1, 1.5, 2], //传入倍速可选数组
|
||||
playbackRate: [0.5, 0.75, 1, 1.5, 2] //传入倍速可选数组
|
||||
});
|
||||
});
|
||||
return {};
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user