vue按需引入element Transfer 穿梭框
程序员文章站
2022-07-06 21:11:37
transfer 穿梭框
按需引入transfer
编辑main.js
import {
...
transfer
} from 'element-...
transfer 穿梭框
按需引入transfer
编辑main.js
import { ... transfer } from 'element-ui'; const components = [ ... transfer ]; components.map(component => { vue.component(component.name, component); });
安装transform-vue-jsx 插件
编辑 .babelrc文件
{ "presets": [ ["env", { "modules": false, "targets": { "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] } }], "stage-2" ], "plugins": [["component", [ { "libraryname": "element-ui", "stylelibraryname": "theme-default" } ]], "transform-runtime", "transform-vue-jsx"], "comments": false }
安装相应插件
npm install babel-plugin-syntax-jsx --save-dev npm install babel-plugin-transform-vue-jsx --save-dev npm install babel-helper-vue-jsx-merge-props --save-dev
总结
以上所述是小编给大家介绍的vue按需引入element transfer 穿梭框,希望对大家有所帮助