node版本必须在10.0.0以上才支持
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install -g yarn
cnpm install -g @vue/cli
cd vue-mansge
npm run serve
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
{
"presets": [["es2015", { "modules": false }]],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
import { Button, Select } from 'element-ui';
import App from './App.vue';
Vue.use(Button)
Vue.use(Select)
npm i vue-router@3
这里注意我们使用的是vue2,对应的路由版本是3
import router from './router'
new Vue({
router,
……
})
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
export default ({
routes: [
{
path: '/',
name: 'Home',
component: () => import()
}
……
]
})
<router-view></router-view>
npm i less
npm i less-loader@5.0.0