diff --git a/build/vite/plugin/index.js b/build/vite/plugin/index.js index d537e86..8b75821 100644 --- a/build/vite/plugin/index.js +++ b/build/vite/plugin/index.js @@ -1,10 +1,11 @@ import vue from '@vitejs/plugin-vue' +import VueSetupExtend from 'vite-plugin-vue-setup-extend' +import { unocss } from './unocss' import { configHtmlPlugin } from './html' import { configMockPlugin } from './mock' -import { unocss } from './unocss' export function createVitePlugins(viteEnv, isBuild) { - const plugins = [vue(), unocss(), configHtmlPlugin(viteEnv, isBuild)] + const plugins = [vue(), VueSetupExtend(), unocss(), configHtmlPlugin(viteEnv, isBuild)] viteEnv?.VITE_APP_USE_MOCK && plugins.push(configMockPlugin(isBuild)) diff --git a/package-lock.json b/package-lock.json index a7274f5..dc65f7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2839,6 +2839,16 @@ } } }, + "vite-plugin-vue-setup-extend": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/vite-plugin-vue-setup-extend/-/vite-plugin-vue-setup-extend-0.3.0.tgz", + "integrity": "sha512-9Nd7Bj4TftB2CoOAD2ZI4cHLW5zjKMF3LNihWbrnAPx3nuGBn33tM9SVUGBVjBB6uv1mGAPavwKCTU0xAD8qhw==", + "dev": true, + "requires": { + "@vue/compiler-sfc": "^3.2.26", + "magic-string": "^0.25.7" + } + }, "vooks": { "version": "0.2.10", "resolved": "https://registry.npmjs.org/vooks/-/vooks-0.2.10.tgz", diff --git a/package.json b/package.json index c93b387..ce173fa 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "unocss": "^0.16.3", "vite": "^2.7.6", "vite-plugin-html": "^2.1.1", - "vite-plugin-mock": "^2.9.6" + "vite-plugin-mock": "^2.9.6", + "vite-plugin-vue-setup-extend": "^0.3.0" } } diff --git a/src/views/test-page/TestDialog.vue b/src/views/test-page/TestDialog.vue index f8c17d0..938d6d6 100644 --- a/src/views/test-page/TestDialog.vue +++ b/src/views/test-page/TestDialog.vue @@ -1,4 +1,4 @@ -