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

相关推荐
charlie1145141915 小时前
嵌入式C++工程实践——第13篇:第一次重构 —— enum class取代宏,类型安全的开始
开发语言·c++·vscode·stm32·安全·重构·现代c++
无限进步_6 小时前
【C++】寻找字符串中第一个只出现一次的字符
开发语言·c++·ide·windows·git·github·visual studio
专职6 小时前
cursor中与vim插件冲突时的配置
编辑器·vim·excel
Just right7 小时前
pycharm卡死在Connected to pydev debugger
ide·python·pycharm
传说中胖子8 小时前
Magento服务器VSCode开启XDebug方法
服务器·vscode·php
秉寒-CHO9 小时前
从 PyCharm 到 Cursor:我的 LLM 项目 AI 编程工具链全解析
ide·人工智能·pycharm
无限进步_9 小时前
【C++】私有虚函数与多态:访问权限不影响动态绑定
开发语言·c++·ide·windows·git·算法·visual studio
拆房老料10 小时前
5分钟上手 OnlyOffice 连接器,打通业务系统与文档编辑器
编辑器·开源软件·js
ct681667810 小时前
Visual Studio 工程配置相关
ide·visual studio·vcpkg
davidson147110 小时前
VSCode配置Claude Code
vscode·ai·大模型·claude