在阅读别人的例子是发现使用了babel的component插件不是很明白是什么意思
.babelrc中的代码片段
"plugins": [
"transform-runtime",
["component", [
{
"libraryName": "element-ui",
"styleLibraryName": "theme-default"
}
]]
],
在阅读别人的例子是发现使用了babel的component插件不是很明白是什么意思
.babelrc中的代码片段
"plugins": [
"transform-runtime",
["component", [
{
"libraryName": "element-ui",
"styleLibraryName": "theme-default"
}
]]
],
2 回答873 阅读✓ 已解决
2 回答917 阅读
1 回答951 阅读
818 阅读
585 阅读
借助 babel-plugin-component,我们可以只引入需要的组件,以达到减小项目体积的目的。如果你只希望引入部分组件,比如 Button 和 Select,那么可以在使用的组件里这样写。
import { Button, Select } from 'element-ui'