vue里想同时用elementui和mintui,babelrc里怎么写两个

按需引入elementui和mintui,可是这两都要设置babelrc里libraryName,应该怎么写
图片描述

阅读 5.7k
3 个回答

https://www.npmjs.com/package...

{
  "plugins": [
    [
      "component",
      {
        libraryName: "antd",
        style: true,
      }, 
      "antd"
    ],
    [
      "component", 
      {
        libraryName: "another-module",
        style: true,
      }, 
      "another-module"
    ]
  ]
}

图片描述

{
"presets": [

["env", {
  "modules": false,
  "targets": {
    "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
  }
}],
"stage-2"

],
"plugins": ["transform-vue-jsx", "transform-runtime",

["component", {
  "libraryName": "mint-ui",
  "style":true
}],
["import",
  {
    "libraryName": "element-ui",
    "styleLibraryName": "theme-chalk"
  }
]

]
}
改成个,另外安装一个 npm install babel-plugin-import --save-dev 就可以了;
另外还有个方案:
"plugins": [

["component",
[{
"libraryName": "mint-ui",
"style": true
},
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}]

]

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题