Home  >  Article  >  Web Front-end  >  Vue introduces element Transfer shuttle box on demand

Vue introduces element Transfer shuttle box on demand

小云云
小云云Original
2018-05-14 16:42:452939browse

In this article, we mainly share with you the relevant information on the on-demand introduction of the element Transfer shuttle box in vue. Friends who need it can refer to it. I hope it can help everyone.

Transfer shuttle box

Introduce Transfer on demand

Edit main.js

import {
 ...
 Transfer
} from 'element-ui';
const components = [
 ...
 Transfer
];
components.map(component => {
 Vue.component(component.name, component);
});

Install transform-vue- jsx plug-in

Edit .babelrc file

{
 "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
}

Install the corresponding plug-in

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

Related recommendations;

HTML5 explanation of dataTransfer object

The above is the detailed content of Vue introduces element Transfer shuttle box on demand. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn