generator-vuepro
v0.0.7
Published
generate element ui admin
Downloads
17
Readme
generator-vuepro
element-ui 2.x admin 架手架
安装
npm install -g yo generator-vuepro
使用
mkdir vuepro-example
cd vuepro-example
yo vuepro
创建组件
yo vuepro:component select-city
即创建两个文件
src/components/select-city/select-city.vue
<template>
<div class="ql-select-city"></div>
</template>
<script>
export default {
name: 'QlSelectCity',
data () {
return {
}
}
}
</script>
<style lang="scss">
@import "../../assets/scss/mixins/mixins.scss";
@import "../../assets/scss/common/var.scss";
@include b(select-city){
}
</style>
src/components/select-city/index.js
import SelectCity from './select-city.vue'
SelectCity.install = Vue => {
Vue.component(SelectCity.name, SelectCity)
}
export default SelectCity
注:组件要手动去 src/main.js 引入
创建页面
yo vuepro:view user-list
即创建一个文件
src/views/user-list/user-list.vue
<template>
<el-card>
</el-card>
</template>
<script>
export default {
name: 'UserList',
data () {
return {
}
}
}
</script>
注:路由要手动去 src/router/nav.config.js 配置