mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-05 21:47:55 +08:00
代码微调
This commit is contained in:
parent
b286b7ffdd
commit
8f9acfcc3a
@ -1,2 +0,0 @@
|
||||
// 误删,该文件用于解决 element plus 在开发环境下按需引入导致页面频繁刷新的问题
|
||||
export default function importElementPlus() {}
|
@ -8,8 +8,7 @@ app.use(pinia)
|
||||
import router from './router'
|
||||
app.use(router)
|
||||
|
||||
import importElementPlus from '@/elementPlusServer'
|
||||
importElementPlus(app)
|
||||
/* importElementPlusPlaceholder */
|
||||
|
||||
import globalProperties from '@/util/global.properties'
|
||||
globalProperties(app)
|
||||
|
@ -60,15 +60,13 @@ export default ({ mode, command }) => {
|
||||
{
|
||||
name: 'dev-auto-import-element-plus',
|
||||
transform(code, id) {
|
||||
if (command === 'serve' && /src\/elementPlusServer.js$/.test(id)) {
|
||||
if (command === 'serve' && /src\/main.js$/.test(id)) {
|
||||
return {
|
||||
code: `
|
||||
import ElementPlus from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
export default function importElementPlus(app) {
|
||||
app.use(ElementPlus);
|
||||
}
|
||||
`,
|
||||
code: code.replace('/* importElementPlusPlaceholder */', `
|
||||
import ElementPlus from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
app.use(ElementPlus);
|
||||
`),
|
||||
map: null
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user