feat: use unplugin-vue-define-options add setup name

This commit is contained in:
xiaoxian521
2022-05-21 12:29:54 +08:00
parent dca722cb29
commit 747e2b9c1c
93 changed files with 2387 additions and 4420 deletions

View File

@@ -1,6 +1,10 @@
<script setup lang="ts">
import { Anchor, AnchorLink } from "@pureadmin/components";
defineOptions({
name: "AntAnchor"
});
function handleAnchorClick(e, link) {
e.preventDefault();
const srcolls = document.getElementById(link.href);

View File

@@ -2,6 +2,10 @@
import { ref } from "vue";
import { Tabs, TabPane } from "@pureadmin/components";
defineOptions({
name: "AntTabs"
});
const mode = ref("top");
const activeKey = ref(1);
const callback = (val: string) => {

View File

@@ -2,6 +2,10 @@
import { ref } from "vue";
import { TreeSelect } from "@pureadmin/components";
defineOptions({
name: "AntTreeSelect"
});
const value1 = ref<string>("");
const treeData1 = ref([
{

View File

@@ -1,6 +1,10 @@
<script setup lang="ts">
import ReBarcode from "/@/components/ReBarcode";
defineOptions({
name: "BarCode"
});
const barcodes = [
{
text: "CODE128",

View File

@@ -9,6 +9,10 @@ import {
} from "/@/utils/chinaArea";
import { ref } from "vue";
defineOptions({
name: "Cascader"
});
const selectedOptions1 = ref(["110000", "110100"]);
const selectedOptions2 = ref(["120000", "120100", "120101"]);
const selectedOptions3 = ref(["130000", ""]);

View File

@@ -3,6 +3,10 @@ import { ElMessage } from "element-plus";
import { debounce } from "/@/utils/debounce";
import { useDebounceFn, useThrottleFn } from "@vueuse/core";
defineOptions({
name: "Debounce"
});
const handle = () => {
ElMessage({
message: "恭喜你,这是一条成功消息",

View File

@@ -1,6 +1,11 @@
<script setup lang="ts">
import { ref } from "vue";
import { IconSelect } from "/@/components/ReIcon";
defineOptions({
name: "IconSelect"
});
let icon = ref("ep:add-location");
</script>

View File

@@ -5,6 +5,10 @@ import ElTreeLine from "/@/components/ReTreeLine";
import { extractPathList, deleteChildren } from "/@/utils/tree";
import { usePermissionStoreHook } from "/@/store/modules/permission";
defineOptions({
name: "LineTree"
});
let menusData = computed(() => {
return deleteChildren(usePermissionStoreHook().menusTree);
});

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "reMenuTree"
};
</script>
<script setup lang="ts">
import { ref, computed } from "vue";
import type { ElTreeV2 } from "element-plus";
@@ -13,6 +7,10 @@ import { extractPathList, deleteChildren } from "/@/utils/tree";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import type { TreeNode } from "element-plus/es/components/tree-v2/src/types";
defineOptions({
name: "MenuTree"
});
interface treeNode extends TreeNode {
meta: {
title: string;

View File

@@ -4,6 +4,10 @@ import { reactive, ref } from "vue";
import { VxeTablePropTypes } from "vxe-table";
import { ReLine } from "../welcome/components";
defineOptions({
name: "Print"
});
interface User {
date: string;
name: string;

View File

@@ -4,6 +4,10 @@ import { ElMessage } from "element-plus";
import avatars from "/@/assets/avatars.jpg";
import ReQrcode from "/@/components/ReQrcode";
defineOptions({
name: "QrCode"
});
const qrcodeText = "vue-pure-admin";
const asyncTitle = ref("");

View File

@@ -6,6 +6,10 @@ import type { SwiperOptions } from "swiper";
import { Swiper, SwiperSlide } from "swiper/vue";
import SwiperCore, { Autoplay, Navigation, Pagination } from "swiper";
defineOptions({
name: "Swiper"
});
type SwiperExampleOptions = Pick<
SwiperOptions,
| "navigation"

View File

@@ -1,7 +1,11 @@
<script setup lang="ts">
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { useRenderFlicker } from "/@/components/ReFlicker";
// eslint-disable-next-line no-undef
defineOptions({
name: "TimeLine"
});
const { lastBuildTime } = __APP_INFO__;
const activities = [
{

View File

@@ -1,6 +1,10 @@
<script setup lang="ts">
import verticalList from "./vertical.vue";
import horizontalList from "./horizontal.vue";
defineOptions({
name: "VirtualList"
});
</script>
<template>

View File

@@ -2,6 +2,10 @@
import { ref } from "vue";
import { useWatermark } from "/@/utils/watermark";
defineOptions({
name: "WaterMark"
});
let color = ref("#409EFF");
let value = ref("vue-pure-admin");
const { setWatermark, clear } = useWatermark();

View File

@@ -4,7 +4,10 @@ export interface schemaItem {
label: string;
}
// eslint-disable-next-line no-undef
defineOptions({
name: "About"
});
const { pkg, lastBuildTime } = __APP_INFO__;
const { dependencies, devDependencies, version } = pkg;

View File

@@ -1,6 +1,11 @@
<script setup lang="ts">
import { ref } from "vue";
import { loadEnv } from "@build/index";
defineOptions({
name: "Button"
});
const { VITE_PUBLIC_PATH } = loadEnv();
const url = ref(`${VITE_PUBLIC_PATH}html/button.html`);

View File

@@ -2,6 +2,10 @@
import basic from "./basic.vue";
import menuGroup from "./menuGroup.vue";
import menuDynamic from "./menuDynamic.vue";
defineOptions({
name: "ContextMenu"
});
</script>
<template>

View File

@@ -1,5 +1,9 @@
<script setup lang="ts">
import { ReNormalCountTo, ReboundCountTo } from "/@/components/ReCountTo";
defineOptions({
name: "CountTo"
});
</script>
<template>

View File

@@ -3,6 +3,10 @@ import { ref, nextTick, getCurrentInstance } from "vue";
import Cropper from "/@/components/ReCropper";
import img from "./picture.jpeg";
defineOptions({
name: "Cropping"
});
let info = ref<object>(null);
let cropperImg = ref<string>("");
const instance = getCurrentInstance();

View File

@@ -3,6 +3,10 @@ import { ref, onMounted } from "vue";
import draggable from "vuedraggable/src/vuedraggable";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "Draggable"
});
let gridLists = ref<Array<Object>>([
{ grid: "cn", num: 1 },
{ grid: "cn", num: 2 },
@@ -36,7 +40,6 @@ const change = (evt): void => {
onMounted(() => {
// 使用原生sortable实现元素位置切换
// @ts-ignore
// eslint-disable-next-line no-undef
new Sortable(document.querySelector(".cut-container"), {
swap: true,
forceFallback: true,

View File

@@ -1,5 +1,9 @@
<script setup lang="ts">
import { Amap } from "/@/components/ReMap";
defineOptions({
name: "Map"
});
</script>
<template>

View File

@@ -3,7 +3,10 @@ import { ref, reactive, unref } from "vue";
import { templateRef } from "@vueuse/core";
import SeamlessScroll from "/@/components/ReSeamlessScroll";
// eslint-disable-next-line no-undef
defineOptions({
name: "SeamlessScroll"
});
const scroll = templateRef<ElRef | null>("scroll", null);
let listData = ref([

View File

@@ -2,6 +2,10 @@
import { ref } from "vue";
import Selector from "/@/components/ReSelector";
defineOptions({
name: "Selector"
});
let selectRange = ref<string>("");
let dataLists = ref([
{

View File

@@ -2,6 +2,10 @@
import splitpane, { ContextProps } from "/@/components/ReSplitPane";
import { reactive } from "vue";
defineOptions({
name: "SplitPane"
});
const settingLR: ContextProps = reactive({
minPercent: 20,
defaultPercent: 40,

View File

@@ -7,6 +7,10 @@ import { deviceDetection } from "/@/utils/deviceDetection";
import playbackRate from "xgplayer/es/controls/playbackRate";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "Video"
});
onMounted(() => {
new Player({
id: "mse",

View File

@@ -1,14 +1,12 @@
<script lang="ts">
export default {
name: "reEditor"
};
</script>
<script setup lang="ts">
import "@wangeditor/editor/dist/css/style.css"; // 引入 css
import { onBeforeUnmount, ref, shallowRef, onMounted } from "vue";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { onBeforeUnmount, ref, shallowRef, onMounted } from "vue";
defineOptions({
name: "Editor"
});
const mode = "default";
// 编辑器实例,必须用 shallowRef
@@ -51,9 +49,9 @@ const handleCreated = editor => {
:icon="useRenderIcon('edit')"
style="font-size: 16px; margin: 0 4px 5px"
>
wangeditor
</el-link></span
>
Wangeditor
</el-link>
</span>
</div>
</template>
<Toolbar

View File

@@ -1,5 +1,9 @@
<script setup lang="ts">
import noAccess from "/@/assets/status/403.svg?component";
defineOptions({
name: "403"
});
</script>
<template>

View File

@@ -1,5 +1,9 @@
<script setup lang="ts">
import noExist from "/@/assets/status/404.svg?component";
defineOptions({
name: "404"
});
</script>
<template>

View File

@@ -1,5 +1,9 @@
<script setup lang="ts">
import noServer from "/@/assets/status/500.svg?component";
defineOptions({
name: "500"
});
</script>
<template>
@@ -21,7 +25,7 @@ import noServer from "/@/assets/status/500.svg?component";
}
}"
>
403
500
</p>
<p
class="mb-4 text-gray-500"

View File

@@ -11,6 +11,10 @@ import { Snapshot, BpmnElement, Menu } from "@logicflow/extension";
import { Control, NodePanel, DataDialog } from "/@/components/ReFlowChart";
import { toLogicflowData } from "/@/components/ReFlowChart/src/adpterForTurbo";
defineOptions({
name: "FlowChart"
});
let lf = ref(null);
let graphData = ref(null);
let dataVisible = ref<boolean>(false);

View File

@@ -3,6 +3,10 @@ import { ref, onBeforeMount } from "vue";
import { loader } from "/@/utils/loaders";
import { ElDesignForm } from "vue-form-create2";
defineOptions({
name: "FormDesign"
});
const loading = ref(true);
onBeforeMount(() => {

View File

@@ -2,6 +2,10 @@
import Driver from "driver.js";
import "driver.js/dist/driver.min.css";
defineOptions({
name: "Guide"
});
const steps = [
{
element: "#header-notice",

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "ReCard"
};
</script>
<script setup lang="ts">
import { computed, PropType } from "vue";
import shopIcon from "/@/assets/svg/shop.svg?component";
@@ -19,6 +13,10 @@ export interface CardProductType {
name: string;
}
defineOptions({
name: "ReCard"
});
const props = defineProps({
product: {
type: Object as PropType<CardProductType>

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "ListCard"
};
</script>
<script setup lang="ts">
import { getCardList } from "/@/api/list";
import Card from "./components/Card.vue";
@@ -12,6 +6,10 @@ import dialogForm from "./components/DialogForm.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "ListCard"
});
const svg = `
<path class="path" d="
M 30 15

View File

@@ -17,6 +17,10 @@ import { bg, avatar, currentWeek } from "./utils/static";
import { ReImageVerify } from "/@/components/ReImageVerify";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "Login"
});
const imgCode = ref("");
const router = useRouter();
const loading = ref(false);

View File

@@ -1,3 +1,15 @@
<script setup lang="ts">
import { ref } from "vue";
import { useI18n } from "vue-i18n";
defineOptions({
name: "Menu1-1"
});
let input = ref("");
const { t } = useI18n();
</script>
<template>
<div>
<p>{{ t("menus.hsmenu1") }}</p>
@@ -5,18 +17,3 @@
<el-input v-model="input" />
</div>
</template>
<script lang="ts">
import { useI18n } from "vue-i18n";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "Menu1-1",
setup() {
const { t } = useI18n();
return {
input: ref(""),
t
};
}
});
</script>

View File

@@ -1,3 +1,15 @@
<script setup lang="ts">
import { ref } from "vue";
import { useI18n } from "vue-i18n";
defineOptions({
name: "Menu1-2-1"
});
let input = ref("");
const { t } = useI18n();
</script>
<template>
<div>
<p>{{ t("menus.hsmenu1") }}</p>
@@ -6,18 +18,3 @@
<el-input v-model="input" />
</div>
</template>
<script lang="ts">
import { useI18n } from "vue-i18n";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "Menu1-2-1",
setup() {
const { t } = useI18n();
return {
input: ref(""),
t
};
}
});
</script>

View File

@@ -1,3 +1,15 @@
<script setup lang="ts">
import { ref } from "vue";
import { useI18n } from "vue-i18n";
defineOptions({
name: "Menu1-2-2"
});
let input = ref("");
const { t } = useI18n();
</script>
<template>
<div>
<p>{{ t("menus.hsmenu1") }}</p>
@@ -6,18 +18,3 @@
<el-input v-model="input" />
</div>
</template>
<script lang="ts">
import { useI18n } from "vue-i18n";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "Menu1-2-2",
setup() {
const { t } = useI18n();
return {
input: ref(""),
t
};
}
});
</script>

View File

@@ -1,3 +1,15 @@
<script setup lang="ts">
import { ref } from "vue";
import { useI18n } from "vue-i18n";
defineOptions({
name: "Menu1-3"
});
let input = ref("");
const { t } = useI18n();
</script>
<template>
<div>
<p>{{ t("menus.hsmenu1") }}</p>
@@ -5,18 +17,3 @@
<el-input v-model="input" />
</div>
</template>
<script lang="ts">
import { useI18n } from "vue-i18n";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "Menu1-3",
setup() {
const { t } = useI18n();
return {
input: ref(""),
t
};
}
});
</script>

View File

@@ -1,21 +1,18 @@
<script setup lang="ts">
import { ref } from "vue";
import { useI18n } from "vue-i18n";
defineOptions({
name: "Menu2"
});
let input = ref("");
const { t } = useI18n();
</script>
<template>
<div>
<p>{{ t("menus.hsmenu2") }}</p>
<el-input v-model="input" />
</div>
</template>
<script lang="ts">
import { useI18n } from "vue-i18n";
import { defineComponent, ref } from "vue";
export default defineComponent({
name: "Menu2",
setup() {
const { t } = useI18n();
return {
input: ref(""),
t
};
}
});
</script>

View File

@@ -1,13 +1,11 @@
<script lang="ts">
export default {
name: "permissionButton"
};
</script>
<script setup lang="ts">
import { ref } from "vue";
import { storageSession } from "/@/utils/storage";
defineOptions({
name: "PermissionButton"
});
const auth = ref<boolean>(storageSession.getItem("info").username || "admin");
function changRole(value) {

View File

@@ -1,14 +1,12 @@
<script lang="ts">
export default {
name: "permissionPage"
};
</script>
<script setup lang="ts">
import { ref, unref } from "vue";
import { storageSession } from "/@/utils/storage";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "PermissionPage"
});
let purview = ref<string>(storageSession.getItem("info").username);
function changRole() {

View File

@@ -1,4 +1,8 @@
<script setup lang="ts"></script>
<script setup lang="ts">
defineOptions({
name: "Fail"
});
</script>
<template>
<el-card>

View File

@@ -1,5 +1,8 @@
<script setup lang="ts">
// eslint-disable-next-line no-undef
defineOptions({
name: "Success"
});
const { lastBuildTime } = __APP_INFO__;
</script>

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "dept"
};
</script>
<script setup lang="ts">
import dayjs from "dayjs";
import { handleTree } from "/@/utils/tree";
@@ -13,6 +7,10 @@ import { reactive, ref, onMounted } from "vue";
import { EpTableProBar } from "/@/components/ReTable";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "Dept"
});
const form = reactive({
user: "",
status: ""

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "dict"
};
</script>
<script setup lang="ts">
import XEUtils from "xe-utils";
import Config from "./config.vue";
@@ -23,6 +17,10 @@ type onEditNRow = {
model: string;
};
defineOptions({
name: "Dict"
});
const { t } = useI18n();
const dictData = reactive({

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "role"
};
</script>
<script setup lang="ts">
import dayjs from "dayjs";
import { getRoleList } from "/@/api/system";
@@ -14,6 +8,10 @@ import { EpTableProBar } from "/@/components/ReTable";
import { Switch, message } from "@pureadmin/components";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "Role"
});
const form = reactive({
name: "",
code: "",

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "user"
};
</script>
<script setup lang="ts">
import dayjs from "dayjs";
import tree from "./tree.vue";
@@ -15,6 +9,10 @@ import { EpTableProBar } from "/@/components/ReTable";
import { Switch, message } from "@pureadmin/components";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
defineOptions({
name: "User"
});
const form = reactive({
username: "",
mobile: "",

View File

@@ -1,5 +1,10 @@
<script setup lang="ts">
import { useDetail } from "./hooks";
defineOptions({
name: "TabDetail"
});
const { initToDetail, id } = useDetail();
initToDetail();
</script>

View File

@@ -11,7 +11,7 @@ export function useDetail() {
useMultiTagsStoreHook().handleTags("push", {
path: `/tabs/detail`,
parentPath: route.matched[0].path,
name: "tabDetail",
name: "TabDetail",
query: { id: String(index) },
meta: {
title: { zh: `No.${index} - 详情信息`, en: `No.${index} - DetailInfo` },
@@ -19,7 +19,7 @@ export function useDetail() {
dynamicLevel: 3
}
});
router.push({ name: "tabDetail", query: { id: String(index) } });
router.push({ name: "TabDetail", query: { id: String(index) } });
}
function initToDetail() {

View File

@@ -10,6 +10,11 @@ import {
getNodeByUniqueId
} from "/@/utils/tree";
import { useDetail } from "./hooks";
defineOptions({
name: "Tabs"
});
const { toDetail, router } = useDetail();
let treeData = computed(() => {

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "Bar"
};
</script>
<script setup lang="ts">
import { ECharts } from "echarts";
import echarts from "/@/plugins/echarts";

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "Line"
};
</script>
<script setup lang="ts">
import { ECharts } from "echarts";
import echarts from "/@/plugins/echarts";

View File

@@ -1,9 +1,3 @@
<script lang="ts">
export default {
name: "Pie"
};
</script>
<script setup lang="ts">
import { ECharts } from "echarts";
import echarts from "/@/plugins/echarts";