feat:添加插件vite-plugin-vue-setup-extend,支持直接在setup script标签定义name
This commit is contained in:
parent
f744043734
commit
5a05c6ee54
@ -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))
|
||||
|
||||
|
10
package-lock.json
generated
10
package-lock.json
generated
@ -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",
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<script setup>
|
||||
<script setup name="TestDialog">
|
||||
import { NButton } from 'naive-ui'
|
||||
const handleDelete = function () {
|
||||
$dialog.confirm({
|
||||
|
Loading…
Reference in New Issue
Block a user