vscode vue 模版生成,vue 一键生成

vscode vue 模版

继上篇文章( vue 格式化),顺便记录下 vue 模版生成。图片就不在贴了,如果有找不到 vscode 插件商店的可以访问上篇文章。

一、安装 VueHelper

在 vscode 软件商店里搜索插件 VueHelper 插件 进行安装。

二、打开 配置文件

打开 vscode 软件 【文件】---【首选项】---【用户代码片段】在弹出的搜索框里输入 vue 查找 vue.json 回车。

三、更改配置

在 vue.json 里加入以下代码,其中的函数方法按个人习惯自己添加。
"Print to console": {
	"prefix": "vue",
	"body": [
			"<template>",
			" <div>\n",
			" </div>",
			"</template>\n",
			"<script>",
			" export default {",
			"   data () {",
			"     return {\n",
			"     }",
			"   },",
			"   components: {\n",
			"   }",
			" }",
			"</script>\n",
			"<style lang='stylus' scoped>\n",
			" ",
			"</style>",
			"$2"
	],
	"description": "Log output to console"
}
最后新建 demo.vue 文件,输入 vue 按下 tab 键,一键生成 vue 模版。

猜你喜欢

转载自www.cnblogs.com/earthZhang/p/12632834.html