A Vue.js 2.0 Mobile UI at YouZan
npm i -S vantUse babel-plugin-import (Recommended)
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "vant", "style": true }]
]
}Then you can import components from vant, equivalent to import manually below.
// import js and css modularly, parsed by babel-plugin-import
import { Button } from 'vant';import { Button } from 'vant';
import 'vant/lib/vant-css/button.css';import Vue from 'vue';
import vant from 'vant';
import 'vant/lib/vant-css/index.css';
Vue.use(vant);make init componentNameStart development mode:
npm run devVisit http://localhost:8080 to see an example of all components.
You can scan the following QR code to access the demo: