diff --git a/.prettierignore b/.prettierignore index 15cf07183..4ff8c9d0c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,7 +3,6 @@ /dist* /public/* /docs/* -/vite.config.ts /src/types/env.d.ts /docs/**/* /plop/**/* diff --git a/src/views/Example/Page/ExampleAdd.vue b/src/views/Example/Page/ExampleAdd.vue index 3903e219c..1c4e3b8d6 100644 --- a/src/views/Example/Page/ExampleAdd.vue +++ b/src/views/Example/Page/ExampleAdd.vue @@ -43,8 +43,8 @@ const save = async () => { {{ t('common.back') }} - - {{ t('exampleDemo.save') }} + {{ t('exampleDemo.save') }} diff --git a/types/components.d.ts b/types/components.d.ts index 8a2967eaa..15b5a6bdf 100644 --- a/types/components.d.ts +++ b/types/components.d.ts @@ -1,8 +1,8 @@ declare module 'vue' { export interface GlobalComponents { - Icon: (typeof import('../components/Icon/src/Icon.vue'))['default'] - Permission: (typeof import('../components/Permission/src/Permission.vue'))['default'] - BaseButton: (typeof import('../components/Button/src/Button.vue'))['default'] + Icon: (typeof import('../src/components/Icon/index'))['Icon'] + Permission: (typeof import('../src/components/Permission/index'))['Permission'] + BaseButton: (typeof import('../src/components/Button/index'))['BaseButton'] } } diff --git a/vite.config.ts b/vite.config.ts index 7fddf87db..38bbfda64 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,10 +5,10 @@ import Vue from '@vitejs/plugin-vue' import VueJsx from '@vitejs/plugin-vue-jsx' import progress from 'vite-plugin-progress' import EslintPlugin from 'vite-plugin-eslint' -import { ViteEjsPlugin } from "vite-plugin-ejs" +import { ViteEjsPlugin } from 'vite-plugin-ejs' import { viteMockServe } from 'vite-plugin-mock' import PurgeIcons from 'vite-plugin-purge-icons' -import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite" +import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' import { createStyleImportPlugin, ElementPlusResolve } from 'vite-plugin-style-import' import UnoCSS from 'unocss/vite' @@ -24,7 +24,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { let env = {} as any const isBuild = command === 'build' if (!isBuild) { - env = loadEnv((process.argv[3] === '--mode' ? process.argv[4] : process.argv[3]), root) + env = loadEnv(process.argv[3] === '--mode' ? process.argv[4] : process.argv[3], root) } else { env = loadEnv(mode, root) } @@ -41,16 +41,18 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { progress(), createStyleImportPlugin({ resolves: [ElementPlusResolve()], - libs: [{ - libraryName: 'element-plus', - esModule: true, - resolveStyle: (name) => { - if (name === 'click-outside') { - return '' + libs: [ + { + libraryName: 'element-plus', + esModule: true, + resolveStyle: (name) => { + if (name === 'click-outside') { + return '' + } + return `element-plus/es/components/${name.replace(/^el-/, '')}/style/css` } - return `element-plus/es/components/${name.replace(/^el-/, '')}/style/css` } - }] + ] }), EslintPlugin({ cache: false, @@ -81,8 +83,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ViteEjsPlugin({ title: env.VITE_APP_TITLE }), - UnoCSS(), - // sveltekit(), + UnoCSS() ], css: { @@ -125,7 +126,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { '/api': { target: 'http://127.0.0.1:8000', changeOrigin: true, - rewrite: path => path.replace(/^\/api/, '') + rewrite: (path) => path.replace(/^\/api/, '') } }, hmr: {