current position:Home>[VSCode] vscode adds vue template

[VSCode] vscode adds vue template

2022-08-06 19:34:29user1584850733009

在vscode中输入vue生成vue文件的模板

效果

在vscode中输入vue可以代码补全
vscodeCode completion effect-1659714430558

步骤

打开vscode
新建一个vue文件
文件–>首选项—>用户代码片段
image
在弹出的搜索框中输入vue,并点击
image-1659713728444

粘贴一下内容,并保存

{
	"Print to console": {
		"prefix": "vue",
		"body": [
			"<template>",
			"<div></div>",
			"</template>",
			"",
			"<script>",
			"",
			"export default {",
			"name: '' ,",
			"components: {},",
			"props:['list'],",
			"data() {",
			"return {",
			"",
			"}",
			"},",
			"computed: {},",
			"watch: {},",
			"created() {",
			"",
			"},",
			"mounted() {",
			"",
			"},",
			"beforeCreate() {",
			"",
			"},",
			"beforeMount() {",
			"",
			"},",
			"beforeUpdate() {",
			"",
			"}, ",
			"updated() {",
			"",
			"}, ",
			"beforeDestroy() {",
			"",
			"},",
			"destroyed() {",
			"",
			"},",
			"activated() {",
			"",
			"},",
			"methods: {",
			"",
			"}",
			"}",
			"</script>",
			"<style lang='less' scoped>",
			"$4",
			"</style>"
		],
		"description": "Log output to console"
	}
}
复制代码

新建一个index.vue文件
输入vue
Press enter or click
vscodeCode completion effect

copyright notice
author[user1584850733009],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/218/202208061924591852.html

Random recommended