@vxecli/import-unplugin-vue-components
v1.0.4
Published
vxe-table 按需加载插件,使用 unplugin-vue-components
Downloads
429
Readme
@vxecli/import-unplugin-vue-components
用于 Vxe 系组件中使用 unplugin-vue-components 来按需加载
Insert
npm install unplugin-vue-components @vxecli/import-unplugin-vue-components
Use
vite
修改文件 vite.config
// ...
import Components from 'unplugin-vue-components/vite'
import { VxeResolver } from '@vxecli/import-unplugin-vue-components'
export default defineConfig({
plugins: [
// ...,
Components({
resolvers: [
VxeResolver({
libraryName: 'vxe-table'
// importStyle: true
}),
VxeResolver({
libraryName: 'vxe-pc-ui'
// importStyle: true
})
]
})
]
})
webpack
修改文件 vue.config
// ...
import Components from 'unplugin-vue-components/webpack'
import { VxeResolver } from '@vxecli/import-unplugin-vue-components'
export default defineConfig({
plugins: [
// ...,
Components({
resolvers: [
VxeResolver({
libraryName: 'vxe-table'
// importStyle: true
}),
VxeResolver({
libraryName: 'vxe-pc-ui'
// importStyle: true
})
]
})
]
})
License
MIT © 2017-present, Xu Liangzhan