refactor!: 使用 defineOptions 设置组件 name

BREAKING CHANGE: 移除 `unplugin-vue-setup-extend-plus` 依赖
This commit is contained in:
Hooray Hu
2023-05-13 00:14:34 +08:00
parent 198dd88e3e
commit bcbe576000
38 changed files with 262 additions and 246 deletions
-1
View File
@@ -71,7 +71,6 @@
"typescript": "^5.0.4",
"unplugin-auto-import": "^0.15.3",
"unplugin-vue-components": "^0.24.1",
"unplugin-vue-setup-extend-plus": "^1.0.0",
"vite": "^4.3.5",
"vite-plugin-banner": "^0.7.0",
"vite-plugin-compression": "^0.5.1",
+6 -2
View File
@@ -1,5 +1,9 @@
<script lang="ts" setup{{#if isGlobal}} name="{{ properCase name }}"{{/if}}>
// 逻辑代码
<script lang="ts" setup>
{{#if isGlobal}}
defineOptions({
name: '{{ properCase name }}',
})
{{/if}}
</script>
<template>
+5 -3
View File
@@ -3,10 +3,12 @@
meta:
title: 页面标题
</route>
{{/if}}
<script lang="ts" setup name="{{ properCase componentName }}">
// 逻辑代码
{{/if}}
<script lang="ts" setup>
defineOptions({
name: '{{ properCase componentName }}',
})
</script>
<template>
-89
View File
@@ -156,9 +156,6 @@ devDependencies:
unplugin-vue-components:
specifier: ^0.24.1
version: 0.24.1(vue@3.3.1)
unplugin-vue-setup-extend-plus:
specifier: ^1.0.0
version: 1.0.0
vite:
specifier: ^4.3.5
version: 4.3.5(sass@1.62.1)(terser@5.17.3)
@@ -761,14 +758,6 @@ packages:
'@babel/types': 7.21.5
dev: true
/@babel/parser@7.21.5:
resolution: {integrity: sha512-J+IxH2IsxV4HbnTrSWgMAQj0UEo61hDA4Ny8h8PCX0MLXiibqHbqIOVneqdocemSBc22VpBKxt4J6FQzy9HarQ==}
engines: {node: '>=6.0.0'}
hasBin: true
dependencies:
'@babel/types': 7.21.5
dev: true
/@babel/parser@7.21.8:
resolution: {integrity: sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==}
engines: {node: '>=6.0.0'}
@@ -2597,15 +2586,6 @@ packages:
- supports-color
dev: true
/@vue/compiler-core@3.2.47:
resolution: {integrity: sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==}
dependencies:
'@babel/parser': 7.21.5
'@vue/shared': 3.2.47
estree-walker: 2.0.2
source-map: 0.6.1
dev: true
/@vue/compiler-core@3.3.1:
resolution: {integrity: sha512-5le1qYSBgLWg2jdLrbydlhnPJkkzMw46UrRUvTnOKlfg6pThtm9ohhqBhNPHbr0RcM1MCbK5WZe/3Ghz0SZjpQ==}
dependencies:
@@ -2614,34 +2594,12 @@ packages:
estree-walker: 2.0.2
source-map-js: 1.0.2
/@vue/compiler-dom@3.2.47:
resolution: {integrity: sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==}
dependencies:
'@vue/compiler-core': 3.2.47
'@vue/shared': 3.2.47
dev: true
/@vue/compiler-dom@3.3.1:
resolution: {integrity: sha512-VmgIsoLivCft3+oNc5KM7b9wd0nZxP/g2qilMwi1hJyGA624KWnNKHn4hzBQs4FpzydUVpNy+TWVT8KiRCh3MQ==}
dependencies:
'@vue/compiler-core': 3.3.1
'@vue/shared': 3.3.1
/@vue/compiler-sfc@3.2.47:
resolution: {integrity: sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==}
dependencies:
'@babel/parser': 7.21.5
'@vue/compiler-core': 3.2.47
'@vue/compiler-dom': 3.2.47
'@vue/compiler-ssr': 3.2.47
'@vue/reactivity-transform': 3.2.47
'@vue/shared': 3.2.47
estree-walker: 2.0.2
magic-string: 0.25.9
postcss: 8.4.23
source-map: 0.6.1
dev: true
/@vue/compiler-sfc@3.3.1:
resolution: {integrity: sha512-G+FPwBbXSLaA4+Ry5/bdD9Oda+sRslQcE9o6JSZaougRiT4OjVL0vtkbQHPrGRTULZV28OcrAjRfSZOSB0OTXQ==}
dependencies:
@@ -2656,13 +2614,6 @@ packages:
postcss: 8.4.23
source-map-js: 1.0.2
/@vue/compiler-ssr@3.2.47:
resolution: {integrity: sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==}
dependencies:
'@vue/compiler-dom': 3.2.47
'@vue/shared': 3.2.47
dev: true
/@vue/compiler-ssr@3.3.1:
resolution: {integrity: sha512-QOQWGNCWuSeyKx4KvWSJlnIMGg+/2oCHgkFUYo7aJ+9Uaaz45yRgKQ+FNigy50NYBQIhpXn2e4OSR8GXh4knrQ==}
dependencies:
@@ -2672,16 +2623,6 @@ packages:
/@vue/devtools-api@6.5.0:
resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==}
/@vue/reactivity-transform@3.2.47:
resolution: {integrity: sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==}
dependencies:
'@babel/parser': 7.21.5
'@vue/compiler-core': 3.2.47
'@vue/shared': 3.2.47
estree-walker: 2.0.2
magic-string: 0.25.9
dev: true
/@vue/reactivity-transform@3.3.1:
resolution: {integrity: sha512-MkOrJauAGH4MNdxGW/PmrDegMyOGX0wGIdKUZJRBXOTpotDONg7/TPJe2QeGeBCow/5v9iOqZOWCfvmOWIaDMg==}
dependencies:
@@ -2724,10 +2665,6 @@ packages:
'@vue/shared': 3.3.1
vue: 3.3.1
/@vue/shared@3.2.47:
resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==}
dev: true
/@vue/shared@3.3.0-beta.4:
resolution: {integrity: sha512-yRrdT1FUWhuLNgj3UUasmToYZ0zR0SOdmVyLa0FHIzbnn00LOiK4lZoPRELMRMnyPy6wwwWHRNmItUeWc2ZGPQ==}
dev: true
@@ -6982,19 +6919,6 @@ packages:
yallist: 4.0.0
dev: true
/magic-string@0.25.9:
resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==}
dependencies:
sourcemap-codec: 1.4.8
dev: true
/magic-string@0.26.7:
resolution: {integrity: sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==}
engines: {node: '>=12'}
dependencies:
sourcemap-codec: 1.4.8
dev: true
/magic-string@0.30.0:
resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==}
engines: {node: '>=12'}
@@ -8780,11 +8704,6 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/sourcemap-codec@1.4.8:
resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==}
deprecated: Please use @jridgewell/sourcemap-codec instead
dev: true
/spdx-correct@3.2.0:
resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==}
dependencies:
@@ -9680,14 +9599,6 @@ packages:
- supports-color
dev: true
/unplugin-vue-setup-extend-plus@1.0.0:
resolution: {integrity: sha512-Qb34atQ/elvkErQ12PNv6UWJPWIG4dEgjjizYKyycPeiRqQaMVNCKqRIqfxlhXntcU2l+o3VQuk1NNZN6QJ/xw==}
dependencies:
'@vue/compiler-sfc': 3.2.47
magic-string: 0.26.7
unplugin: 1.3.1
dev: true
/unplugin@1.2.0:
resolution: {integrity: sha512-7lJXQY4CxOK4jZyVskZuuNBqBSOlxezKqBpfQEpH+Odk2Ban3moKAlvzs9rZuZoZp6/1FEhvY9TZXav2FRhaBg==}
dependencies:
+5 -1
View File
@@ -1,8 +1,12 @@
<script lang="ts" setup name="Auth">
<script lang="ts" setup>
const props = defineProps<{
value: string | string[]
}>()
defineOptions({
name: 'Auth',
})
function check() {
return useAuth().auth(props.value)
}
+5 -1
View File
@@ -1,8 +1,12 @@
<script lang="ts" setup name="AuthAll">
<script lang="ts" setup>
const props = defineProps<{
value: string[]
}>()
defineOptions({
name: 'AuthAll',
})
function check() {
return useAuth().authAll(props.value)
}
+5 -1
View File
@@ -1,6 +1,10 @@
<script lang="ts" setup name="Copyright">
<script lang="ts" setup>
import useSettingsStore from '@/store/modules/settings'
defineOptions({
name: 'Copyright',
})
const route = useRoute()
const settingsStore = useSettingsStore()
</script>
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="FileUpload">
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import type { UploadProps, UploadUserFile } from 'element-plus'
@@ -43,6 +43,10 @@ const props = defineProps({
const emit = defineEmits(['onSuccess'])
defineOptions({
name: 'FileUpload',
})
const beforeUpload: UploadProps['beforeUpload'] = (file) => {
const fileName = file.name.split('.')
const fileExt = fileName.at(-1)
+5 -1
View File
@@ -1,6 +1,10 @@
<script lang="ts" setup name="FixedActionBar">
<script lang="ts" setup>
const isBottom = ref(false)
defineOptions({
name: 'FixedActionBar',
})
onMounted(() => {
onScroll()
window.addEventListener('scroll', onScroll)
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="ImagePreview">
<script lang="ts" setup>
const props = defineProps({
src: {
type: String,
@@ -14,6 +14,10 @@ const props = defineProps({
},
})
defineOptions({
name: 'ImagePreview',
})
const realWidth = computed(() => {
return typeof props.width === 'string' ? props.width : `${props.width}px`
})
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="ImageUpload">
<script lang="ts" setup>
import type { UploadProps } from 'element-plus'
import { ElMessage } from 'element-plus'
@@ -51,6 +51,10 @@ const props = defineProps({
const emit = defineEmits(['update:url', 'onSuccess'])
defineOptions({
name: 'ImageUpload',
})
const uploadData = ref({
imageViewerVisible: false,
progress: {
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="ImagesUpload">
<script lang="ts" setup>
import type { UploadProps } from 'element-plus'
import { ElMessage } from 'element-plus'
@@ -55,6 +55,10 @@ const props = defineProps({
const emit = defineEmits(['update:url', 'onSuccess'])
defineOptions({
name: 'ImagesUpload',
})
const uploadData = ref({
dialogImageIndex: 0,
imageViewerVisible: false,
+4
View File
@@ -1,4 +1,8 @@
<script lang="ts" setup>
defineOptions({
name: 'NotAllowed',
})
const router = useRouter()
const data = ref({
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="PageHeader">
<script lang="ts" setup>
defineProps({
title: {
type: String,
@@ -10,6 +10,10 @@ defineProps({
},
})
defineOptions({
name: 'PageHeader',
})
const slots = useSlots()
</script>
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="PageMain">
<script lang="ts" setup>
const props = defineProps({
title: {
type: String,
@@ -14,6 +14,10 @@ const props = defineProps({
},
})
defineOptions({
name: 'PageMain',
})
const titleSlot = !!useSlots().title
const collaspeData = ref(props.collaspe)
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="PcasCascader">
<script lang="ts" setup>
// 行政区划数据来源于 https://github.com/modood/Administrative-divisions-of-China
import pcasRaw from './pcas-code.json'
@@ -23,6 +23,10 @@ const props = defineProps({
const emit = defineEmits(['update:modelValue'])
defineOptions({
name: 'PcasCascader',
})
interface pcasItem {
code: string
name: string
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="SearchBar">
<script lang="ts" setup>
const props = defineProps({
fold: {
type: Boolean,
@@ -19,6 +19,10 @@ const emit = defineEmits<{
(event: 'toggle', value: boolean): void
}>()
defineOptions({
name: 'SearchBar',
})
const isFold = ref(props.fold)
watch(() => props.fold, (value) => {
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="SvgIcon">
<script lang="ts" setup>
import { Icon } from '@iconify/vue'
const props = defineProps({
@@ -16,6 +16,10 @@ const props = defineProps({
},
})
defineOptions({
name: 'SvgIcon',
})
const transformStyle = computed(() => {
const style = []
if (props.flip !== '') {
-3
View File
@@ -16,9 +16,6 @@ onMounted(() => {
<div>
<el-drawer v-model="isShow" title="系统信息" direction="rtl" :size="360">
<el-descriptions direction="vertical" :column="1" border>
<el-descriptions-item label="版本号" align="center">
{{ pkg.version }}
</el-descriptions-item>
<el-descriptions-item label="最后编译时间" align="center">
{{ lastBuildTime }}
</el-descriptions-item>
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="Trend">
<script lang="ts" setup>
const props = defineProps({
value: {
type: String,
@@ -22,6 +22,10 @@ const props = defineProps({
},
})
defineOptions({
name: 'Trend',
})
const isUp = computed(() => {
let isUp = props.type === 'up'
if (props.reverse) {
+5 -1
View File
@@ -1,10 +1,14 @@
<script lang="ts" setup name="AppSetting">
<script lang="ts" setup>
import { useClipboard } from '@vueuse/core'
import { ElMessage } from 'element-plus'
import eventBus from '@/utils/eventBus'
import useSettingsStore from '@/store/modules/settings'
import useMenuStore from '@/store/modules/menu'
defineOptions({
name: 'AppSetting',
})
const route = useRoute()
const settingsStore = useSettingsStore()
+5 -1
View File
@@ -1,9 +1,13 @@
<script lang="ts" setup name="Header">
<script lang="ts" setup>
import Logo from '../Logo/index.vue'
import Tools from '../Tools/index.vue'
import useSettingsStore from '@/store/modules/settings'
import useMenuStore from '@/store/modules/menu'
defineOptions({
name: 'Header',
})
const settingsStore = useSettingsStore()
const menuStore = useMenuStore()
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="Logo">
<script lang="ts" setup>
import imgLogo from '@/assets/images/logo.png'
import useSettingsStore from '@/store/modules/settings'
@@ -13,6 +13,10 @@ defineProps({
},
})
defineOptions({
name: 'Logo',
})
const settingsStore = useSettingsStore()
const title = ref(import.meta.env.VITE_APP_TITLE)
+5 -1
View File
@@ -1,8 +1,12 @@
<script lang="ts" setup name="MainSidebar">
<script lang="ts" setup>
import Logo from '../Logo/index.vue'
import useSettingsStore from '@/store/modules/settings'
import useMenuStore from '@/store/modules/menu'
defineOptions({
name: 'MainSidebar',
})
const settingsStore = useSettingsStore()
const menuStore = useMenuStore()
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="Search">
<script lang="ts" setup>
import { cloneDeep } from 'lodash-es'
import hotkeys from 'hotkeys-js'
import type { RouteRecordRaw } from 'vue-router'
@@ -8,6 +8,10 @@ import useRouteStore from '@/store/modules/route'
import useMenuStore from '@/store/modules/menu'
import type { Menu } from '#/global'
defineOptions({
name: 'Search',
})
const router = useRouter()
const settingsStore = useSettingsStore()
+5 -2
View File
@@ -1,5 +1,4 @@
<script lang="ts" setup name="SidebarItem">
// import SidebarItem from './index.vue'
<script lang="ts" setup>
import { resolveRoutePath } from '@/utils'
import useSettingsStore from '@/store/modules/settings'
import type { Menu } from '#/global'
@@ -15,6 +14,10 @@ const props = defineProps({
},
})
defineOptions({
name: 'SidebarItem',
})
const settingsStore = useSettingsStore()
const hasChildren = computed(() => {
+5 -1
View File
@@ -1,9 +1,13 @@
<script lang="ts" setup name="SubSidebar">
<script lang="ts" setup>
import Logo from '../Logo/index.vue'
import SidebarItem from '../SidebarItem/index.vue'
import useSettingsStore from '@/store/modules/settings'
import useMenuStore from '@/store/modules/menu'
defineOptions({
name: 'SubSidebar',
})
const settingsStore = useSettingsStore()
const menuStore = useMenuStore()
+5 -1
View File
@@ -1,9 +1,13 @@
<script lang="ts" setup name="Tools">
<script lang="ts" setup>
import { useFullscreen } from '@vueuse/core'
import eventBus from '@/utils/eventBus'
import useSettingsStore from '@/store/modules/settings'
import useUserStore from '@/store/modules/user'
defineOptions({
name: 'Tools',
})
const router = useRouter()
const settingsStore = useSettingsStore()
+5 -1
View File
@@ -1,8 +1,12 @@
<script lang="ts" setup name="Topbar">
<script lang="ts" setup>
import { compile } from 'path-to-regexp'
import Tools from '../Tools/index.vue'
import useSettingsStore from '@/store/modules/settings'
defineOptions({
name: 'Topbar',
})
const route = useRoute()
const settingsStore = useSettingsStore()
+5 -1
View File
@@ -1,4 +1,8 @@
<script lang="ts" setup name="LinkView">
<script lang="ts" setup>
defineOptions({
name: 'LinkView',
})
const route = useRoute()
function open() {
+5 -1
View File
@@ -1,4 +1,4 @@
<script lang="ts" setup name="Layout">
<script lang="ts" setup>
import hotkeys from 'hotkeys-js'
import LinkView from './components/views/link.vue'
import Header from './components/Header/index.vue'
@@ -13,6 +13,10 @@ import useKeepAliveStore from '@/store/modules/keepAlive'
import useMenuStore from '@/store/modules/menu'
import eventBus from '@/utils/eventBus'
defineOptions({
name: 'Layout',
})
const routeInfo = useRoute()
const settingsStore = useSettingsStore()
+106 -111
View File
@@ -86,110 +86,89 @@ const oneStepAdminInfo = ref({
</page-header>
<el-row :gutter="20" style="margin: 0 10px;">
<el-col :lg="8">
<page-main style="margin: 0;">
<div class="ecology vue">
<div class="main">
<img src="https://cn.vuejs.org/logo.svg" style="width: 30%;">
<h1>Fantastic-startkit</h1>
<h2>一款开箱即用的 Vue 项目启动套件</h2>
<page-main class="ecology vue">
<template #title>
<div class="title-info">
<img src="https://cn.vuejs.org/logo.svg">
<div>
<el-button type="primary" plain @click="open('https://hooray.gitee.io/fantastic-startkit/')">
<template #icon>
<el-icon>
<svg-icon name="ep:link" />
</el-icon>
</template>
访问官网
</el-button>
<el-button plain @click="open('https://hooray.github.io/fantastic-startkit/')">
<template #icon>
<el-icon>
<svg-icon name="ep:link" />
</el-icon>
</template>
备用地址
</el-button>
<h1>Fantastic-startkit</h1>
<h2>一款开箱即用的 Vue 项目启动套件</h2>
</div>
</div>
<el-divider border-style="dashed" />
<ul>
<li v-for="item in fantasticStartkitInfo.feature" :key="item">
{{ item }}
</li>
</ul>
</div>
<el-dropdown split-button type="primary" @click="open('https://hooray.gitee.io/fantastic-startkit/')">
访问官网
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="open('https://hooray.github.io/fantastic-startkit/')">
备用地址
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
<ul>
<li v-for="item in fantasticStartkitInfo.feature" :key="item">
{{ item }}
</li>
</ul>
</page-main>
</el-col>
<el-col :lg="8">
<page-main style="margin: 0;">
<div class="ecology fa">
<div class="main">
<img src="https://hooray.gitee.io/fantastic-admin/logo.png" style="width: 30%;">
<h1>Fantastic-admin</h1>
<h2>一款开箱即用的 Vue 中后台管理系统框架</h2>
<page-main class="ecology fa">
<template #title>
<div class="title-info">
<img src="https://hooray.gitee.io/fantastic-admin/logo.png">
<div>
<el-button type="primary" plain @click="open('https://hooray.gitee.io/fantastic-admin/')">
<template #icon>
<el-icon>
<svg-icon name="ep:link" />
</el-icon>
</template>
访问官网
</el-button>
<el-button plain @click="open('https://hooray.github.io/fantastic-admin/')">
<template #icon>
<el-icon>
<svg-icon name="ep:link" />
</el-icon>
</template>
备用地址
</el-button>
<h1>Fantastic-admin</h1>
<h2>一款开箱即用的 Vue 中后台管理系统框架</h2>
</div>
</div>
<el-divider border-style="dashed" />
<el-carousel trigger="click" indicator-position="none" :interval="5000" height="250px">
<el-carousel-item v-for="(item, index) in fantasticAdminInfo.data" :key="item">
<el-image :src="item" fit="cover" style="cursor: pointer; width: 100%; height: 250px; margin: auto;" @click="fantasticAdminInfo.imageVisible = true; fantasticAdminInfo.index = index" />
</el-carousel-item>
</el-carousel>
<el-image-viewer v-if="fantasticAdminInfo.imageVisible" :url-list="fantasticAdminInfo.data" :initial-index="fantasticAdminInfo.index" @close="fantasticAdminInfo.imageVisible = false" />
</div>
<el-dropdown split-button type="primary" @click="open('https://hooray.gitee.io/fantastic-admin/')">
访问官网
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="open('https://hooray.github.io/fantastic-admin/')">
备用地址
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
<el-carousel trigger="click" indicator-position="none" :interval="5000" height="250px">
<el-carousel-item v-for="(item, index) in fantasticAdminInfo.data" :key="item">
<el-image :src="item" fit="cover" style="cursor: pointer; width: 100%; height: 250px; margin: auto;" @click="fantasticAdminInfo.imageVisible = true; fantasticAdminInfo.index = index" />
</el-carousel-item>
</el-carousel>
<el-image-viewer v-if="fantasticAdminInfo.imageVisible" :url-list="fantasticAdminInfo.data" :initial-index="fantasticAdminInfo.index" @close="fantasticAdminInfo.imageVisible = false" />
</page-main>
</el-col>
<el-col :lg="8">
<page-main style="margin: 0;">
<div class="ecology osa">
<div class="main">
<img src="https://hooray.gitee.io/one-step-admin/logo.png" style="width: 30%;">
<h1>One-step-admin</h1>
<h2>一款干啥都快人一步的 Vue 中后台系统框架</h2>
<page-main class="ecology osa">
<template #title>
<div class="title-info">
<img src="https://hooray.gitee.io/one-step-admin/logo.png">
<div>
<el-button type="primary" plain @click="open('https://hooray.gitee.io/one-step-admin/')">
<template #icon>
<el-icon>
<svg-icon name="ep:link" />
</el-icon>
</template>
访问官网
</el-button>
<el-button plain @click="open('https://hooray.github.io/one-step-admin/')">
<template #icon>
<el-icon>
<svg-icon name="ep:link" />
</el-icon>
</template>
备用地址
</el-button>
<h1>One-step-admin</h1>
<h2>一款干啥都快人一步的 Vue 中后台系统框架</h2>
</div>
</div>
<el-divider border-style="dashed" />
<el-carousel trigger="click" indicator-position="none" :interval="5000" height="250px">
<el-carousel-item v-for="(item, index) in oneStepAdminInfo.data" :key="item">
<el-image :src="item" fit="cover" style="cursor: pointer; width: 100%; height: 250px; margin: auto;" @click="oneStepAdminInfo.imageVisible = true; oneStepAdminInfo.index = index" />
</el-carousel-item>
</el-carousel>
<el-image-viewer v-if="oneStepAdminInfo.imageVisible" :url-list="oneStepAdminInfo.data" :initial-index="oneStepAdminInfo.index" @close="oneStepAdminInfo.imageVisible = false" />
</div>
<el-dropdown split-button type="primary" @click="open('https://hooray.gitee.io/one-step-admin/')">
访问官网
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="open('https://hooray.github.io/one-step-admin/')">
备用地址
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
<el-carousel trigger="click" indicator-position="none" :interval="5000" height="250px">
<el-carousel-item v-for="(item, index) in oneStepAdminInfo.data" :key="item">
<el-image :src="item" fit="cover" style="cursor: pointer; width: 100%; height: 250px; margin: auto;" @click="oneStepAdminInfo.imageVisible = true; oneStepAdminInfo.index = index" />
</el-carousel-item>
</el-carousel>
<el-image-viewer v-if="oneStepAdminInfo.imageVisible" :url-list="oneStepAdminInfo.data" :initial-index="oneStepAdminInfo.index" @close="oneStepAdminInfo.imageVisible = false" />
</page-main>
</el-col>
</el-row>
@@ -224,7 +203,44 @@ const oneStepAdminInfo = ref({
}
.ecology {
padding: 10px 0 0;
margin: 0;
height: 100%;
:deep(.title-container) {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 20px;
.title-info {
flex: 1 1 400px;
display: flex;
align-items: center;
gap: 20px;
img {
width: 50px;
display: block;
}
h1 {
margin: 0;
font-size: 24px;
}
h2 {
margin: 0;
font-size: 16px;
font-weight: normal;
color: var(--el-text-color-secondary);
}
}
.el-dropdown {
margin-left: auto;
}
}
&.vue {
h1 {
@@ -244,27 +260,6 @@ const oneStepAdminInfo = ref({
}
}
.main {
text-align: center;
img {
display: block;
margin: 0 auto;
}
h1 {
margin: 10px auto 0;
text-align: center;
}
h2 {
font-size: 16px;
font-weight: normal;
color: var(--el-text-color-secondary);
text-align: center;
}
}
.el-carousel {
box-shadow: var(--el-box-shadow-light);
transition: var(--el-transition-box-shadow);
+5 -1
View File
@@ -5,11 +5,15 @@ meta:
layout: false
</route>
<script lang="ts" setup name="Login">
<script lang="ts" setup>
import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user'
defineOptions({
name: 'Login',
})
const route = useRoute()
const router = useRouter()
+5 -1
View File
@@ -4,11 +4,15 @@ meta:
title: 修改密码
</route>
<script lang="ts" setup name="PersonalEditPassword">
<script lang="ts" setup>
import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user'
defineOptions({
name: 'PersonalEditPassword',
})
const userStore = useUserStore()
const formRef = ref<FormInstance>()
+5 -1
View File
@@ -5,10 +5,14 @@ meta:
cache: personal-edit.password
</route>
<script lang="ts" setup name="PersonalSetting">
<script lang="ts" setup>
import type { UploadProps } from 'element-plus'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'PersonalSetting',
})
const router = useRouter()
const form = ref({
-2
View File
@@ -6,7 +6,6 @@ import vueLegacy from '@vitejs/plugin-legacy'
import createInspector from './inspector'
import createAutoImport from './auto-import'
import createComponents from './components'
import createSetupExtend from './setup-extend'
import createSvgIcon from './svg-icon'
import createMock from './mock'
import createLayouts from './layouts'
@@ -30,7 +29,6 @@ export default function createVitePlugins(viteEnv, isBuild = false) {
vitePlugins.push(createInspector())
vitePlugins.push(createAutoImport())
vitePlugins.push(createComponents())
vitePlugins.push(createSetupExtend())
vitePlugins.push(createSvgIcon(isBuild))
vitePlugins.push(createMock(viteEnv, isBuild))
vitePlugins.push(createLayouts())
-5
View File
@@ -1,5 +0,0 @@
import setupExtend from 'unplugin-vue-setup-extend-plus/vite'
export default function createSetupExtend() {
return setupExtend({})
}