3.6.2 • Published 3 years ago
mingxin-components-lib v3.6.2
安装插件库 npm install mingxin-components-lib -S
全局引入
在main.js中 import MCL from "mingxin-components-lib" Vue.use(MCL)
按需引入配置
npm install babel-plugin-import --save-dev
项目根目录新建.babelrc.js文件
内容如下:
module.exports = {
"presets": "@vue/app",
"plugins": [
[
"import",
{
"libraryName": "mingxin-components-lib",
"camel2DashComponentName": false,
"camel2UnderlineComponentName": false,
"style": (name) =>{
const cssName = name.split('/')2;
return mingxin-components-lib/lib/style/${cssName}.css
}
}
],
]
}