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

相关推荐
dyxal1 小时前
VS Code 终端疑难杂症排查:为什么 PowerShell 无法启动?
vscode
【ql君】qlexcel1 小时前
Visual Studio Code开发STM32设置头文件宏定义uint32_t报错
vscode·stm32·vs code·头文件宏定义·uint32_t报错·uint8_t报错·uint16_t报错
琉璃榴1 小时前
Visual Studio Code连接远程服务器
服务器·vscode·github
HuDie3403 小时前
agent项目实操笔记
ide
jieyucx3 小时前
Golang 完整安装与 VSCode 开发环境搭建教程
开发语言·vscode·golang
梦魇星虹4 小时前
idea Cannot find declaration to go to
java·ide·intellij-idea
xifangge20254 小时前
【故障排查】IDEA 打开 Java 文件没有运行按钮(Run)?深度解析项目标识与环境配置的 3 大底层坑点
java·ide·intellij-idea
Codiggerworld6 小时前
Vim的语法:删除、复制、粘贴,像说话一样自然
编辑器·vim·excel
刘延林.6 小时前
Visual Studio Code+PlatformIO + ESP32-S3 + Arduino 框架点亮一个小的led灯-测试
ide·vscode·编辑器
黑客大白7 小时前
IDEA安装教程配置java环境(超详细)_idea配置java,零基础入门到精通,收藏这篇就够了
java·ide·intellij-idea