Skip to content

Commit

Permalink
发布,组件都修改为按需引入减少体积
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Nov 7, 2023
1 parent 4ca8c19 commit d72560a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions GoEasyDesigner/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import './assets/main.css'

import {createApp} from 'vue'
import {createPinia} from 'pinia'
import ElementPlus from 'element-plus'
// import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import TDesign from 'tdesign-vue-next'
// import TDesign from 'tdesign-vue-next'
import 'tdesign-vue-next/es/style/index.css'

import Helper from "./Helper.js"
Expand Down Expand Up @@ -193,8 +193,8 @@ app.config.globalProperties.t = i18n.global.t


app.use(i18n)
app.use(TDesign)
app.use(ElementPlus)
// app.use(TDesign)
// app.use(ElementPlus)
app.mount('#app')


9 changes: 7 additions & 2 deletions GoEasyDesigner/frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import vue from '@vitejs/plugin-vue'

import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
import {ElementPlusResolver, TDesignResolver} from 'unplugin-vue-components/resolvers'
import IconsResolver from 'unplugin-icons/resolver'
import vueJsx from '@vitejs/plugin-vue-jsx'


// https://vitejs.dev/config/
export default defineConfig({
server: {
Expand Down Expand Up @@ -37,6 +36,9 @@ export default defineConfig({
IconsResolver({
prefix: 'Icon',
}),
TDesignResolver({
library: 'vue-next'
})
],
}),
Components({
Expand All @@ -49,6 +51,9 @@ export default defineConfig({
// Auto register Element Plus components
// 自动导入 Element Plus 组件
ElementPlusResolver(),
TDesignResolver({
library: 'vue-next'
})
],
}),

Expand Down
2 changes: 1 addition & 1 deletion go-easy-demo

0 comments on commit d72560a

Please sign in to comment.