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",按下回车键,自动生成模板

相关推荐
CSDN_RTKLIB5 小时前
Visual Studio不改变文件编码情况下解决C2001
c++·ide·visual studio
一只大马猴呀8 小时前
IntelliJ IDEA 中启动项目不显示端口号
java·ide·intellij-idea
史丹利复合田10 小时前
【无标题】vscode远程连接,服务器端配置
ide·vscode·编辑器
wtsolutions11 小时前
图片GPS数据编辑器批量处理功能详解 - 高效管理大量图片的位置信息
编辑器·gps·图片·照片
cooldream200911 小时前
Vim 报错 E325:swap 文件冲突的原理、处理流程与彻底避免方案
linux·编辑器·vim
gusijin12 小时前
解决idea启动报错java: OutOfMemoryError: insufficient memory
java·ide·intellij-idea
吨~吨~吨~12 小时前
解决 IntelliJ IDEA 运行时“命令行过长”问题:使用 JAR
java·ide·intellij-idea
HAPPY酷12 小时前
为啥双击 .sln 文件即可在 Visual Studio 中加载整个解决方案
ide·visual studio
summer_du12 小时前
IDEA插件下载缓慢,如何解决?
java·ide·intellij-idea
iwanghang13 小时前
Android Studio 2023.2.1 新建项目 不能选择Java 解决方法
android·ide·android studio