# kscpm 
> 基于 Generator 的构建器 , 建议 **Node 11+** 

## 基础命令
```shell 
$ npm install  # 安装 或者 yarn add 
$ npm run dev  # 启动
$ npm run build # 打包构建 基于webpack
$ npm run jest # jest单元测试
$ npm run jest:c # jest --coverage
$ # 更多请参考 package.json
```

## 已支持
- TypeScript
- Vue (2.6.0)
- Vuex
- [vuex-class](https://www.npmjs.com/package/vuex-class)
- [Vue-Router](https://router.vuejs.org/zh/api/)
- [vue-property-decorator](https://www.npmjs.com/package/vue-property-decorator)
- [vuex-module-decorators](https://www.npmjs.com/package/vuex-module-decorators)

## 功能
- 支持自定义菜单面包屑内容
- 支持二级菜单
- 支持Ts语法，支持ESLint
- 支持装饰器语法，Vue、Vuex 已支持
- 支持Jest测试 
<br/>

## ☛ 多级菜单配置
> 目前只支持二级菜单，遵循  [Vue-Router](https://router.vuejs.org/zh/api/) 语法规范
<br/>

| param | required | type |default |
| :---: | :--------: | :--: |:--: |
| meta.title | ✅   |  string | |
| meta.belong | ✅  |  string | |
| meta.showMenuTitle | ❎  |  boolean  |  true|
| meta.showMenu | ❎  | boolean  | true |
| meta.showBread | ❎  | boolean  |  true|
| meta.breadcrumbs | ❎  | Array | []|


<br/>

## Vue示例
```JS
# index.ts
import Vue from 'vue'
import { Component  , Mixins , Prop , Watch , Ref , Emit} from 'vue-property-decorator'
import {namespace , Mutation , Getter } from 'vuex-class'

@Component(
	//组件
)
export default class vueDemo extends Vue {
	@Watch('watchParam')
	watchSome(){}

    @Getter("info") info! : any  
    @Mutation("info") info : any  

    @Ref('ref') readonly comRef! : any 
    
    @Prop( Boolean ) readonly propParam! : boolean ;
	
} 

```

## Vuex示例
```JS
import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators'

@Module
export default class VuexDemo extends VuexModule {
   @Mutation
   mutationEvent(data){}

   @Action({commit : 'actionCommit'})
   actionEvent(){
	   //do something 
   }

}
```

