还在为写.vue文件烦恼吗?快来用dot-vue-cli交互式生成吧!

码农天地 -
还在为写.vue文件烦恼吗?快来用dot-vue-cli交互式生成吧!
写过vue的同学都知道,单文件组件.vue在开发中使用频率是非常高的。

如果不想再手写或者CV的话,不妨尝试一下我写的这个小工具,支持交互式生成.vue文件,生成的过程只需要回答一些小问题即可。

目前仅支持vue2和部分属性,如果对这个项目感兴趣的话,欢迎提issue,欢迎提pr(合适的话我会第一时间merge),或者fork一份改成自己想要的效果吧

项目地址:https://github.com/FrankKai/dot-vue-cli

dot-vue-cli

Vue2.x single file component .vue generator.

featuresSet name, props, data, computed, watch and choose lifecycles, methods by interactive command line.Import vuex, mapState, mapMutations, mapActions by interactive command line.install
npm install -g dot-vue-cli
usage
dot-vue

Type dot-vue in terminal and follow the instructions.

process1.generate template configs
{
  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"],
};
2.generate target .vue file based on template literals


Enjoy it !

特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。
下一篇: Vue ssr

Tags 标签

加个好友,技术交流

1628738909466805.jpg