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

Vue introduces element Transfer shuttle box on demand

小云云
Release: 2018-05-14 16:42:45
Original
3016 people have browsed it

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);
});
Copy after login

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
}
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template