vscode 快速生成vue 格式

1.用快捷Ctrl + Shift + P唤出控制台

输入"Snippets"并选择 Snippets: Configure User Snippets

2.输入vue,选中vue.json

vs code自动生成vue.json文件

3.在 vue.json 中添加模板

复制代码
{
	"Print to console": {
			"prefix": "vue2",
			"body": [
					"<template>",
					"  <div></div>",
					"</template>",
					"",
					"<script>",
					"export default {",
					"  components: {},",
					"  props: {},",
					"  data() {",
					"    return {",
					"    };",
					"  },",
					"  watch: {},",
					"  computed: {},",
					"  methods: {},",
					"  created() {},",
					"  mounted() {}",
					"};",
					"</script>",
					"<style lang=\"less\" scoped>",
					"</style>"
			],
			"description": "A vue file template"
	}
}

4.新建一个 vue 文件,输入"vue2",按下回车键,自动生成模板

相关推荐
徐小夕@趣谈前端32 分钟前
Web文档的“Office时刻“:jitword共建版2.0发布!让浏览器变成本地生产力
前端·数据结构·vue.js·算法·开源·编辑器·es6
电饭叔2 小时前
Jupyter学习中的问题--FileNotFoundError
ide·学习·jupyter
noBt3 小时前
Windows IDEA 卡顿严重
java·ide·intellij-idea
小疙瘩7 小时前
去掉 IDEA 中 mybatis配置文件的局部背景颜色(图解)
java·ide·intellij-idea
zhanglianzhao7 小时前
Win 11 WSL 配置Claude code 并在VsCode中使用
ide·vscode·编辑器·claude·cladue code
Keying,,,,7 小时前
VScode中终端闪退问题
ide·vscode·编辑器
热爱生活的五柒8 小时前
如何在vscode中使用Claude code以及插件中配置setting.json无效的解决方法
ide·vscode·编辑器
ONLYOFFICE8 小时前
ONLYOFFICE 自动化工具:宏和 AI 函数如何选择?
运维·自动化·编辑器·onlyoffice
dzj20219 小时前
Visual Studio2022中好用的AI编码工具介绍——Windsurf(Codeium)
ide·ai·visual studio·code
浩瀚之水_csdn9 小时前
vscode中运行html语言
ide·vscode·html