寫過vue的同窗都知道,單文件組件.vue在開發中使用頻率是很是高的。若是不想再手寫或者CV的話,不妨嘗試一下我寫的這個小工具,支持交互式生成.vue文件,生成的過程只須要回答一些小問題便可。javascript
目前僅支持vue2和部分屬性,若是對這個項目感興趣的話,歡迎提issue,歡迎提pr(合適的話我會第一時間merge),或者fork一份改爲本身想要的效果吧vue
項目地址:
https://github.com/FrankKai/dot-vue-cli
java
Vue2.x single file component .vue generator.git
name
, props
, data
, computed
, watch
and choose lifecycles
, methods
by interactive command line.mapState
, mapMutations
, mapActions
by interactive command line.npm install -g dot-vue-cli
dot-vue
Type dot-vue
in terminal and follow the instructions.github
{ filename: "foo", name: "foo", data: true, "data details": "a,b,c", computed: true, "computed details": "a,b,c", watch: true, "watch details": "a,b,c", methods: true, "methods details": "a,b,c", "vue lifecycle hooks": ["mounted", "destroyed"], "vuex helpers": ["mapState", "mapMutations", "mapActions"], };
Enjoy it !vuex