vue3代码片段模版与VSCode设置

导读:本篇文章讲解 vue3代码片段模版与VSCode设置,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com

一、前言

我们在使用vue3开发中,和vue2中的模板还是有差距的,所以我们需要换一下模板,防止大家辛苦的自己敲,小编这里给大家敲好了!粘贴即用哈!!觉得有用的给小编点个关注哈!!!

二、代码片段

{
	// Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	"Print to console": {
		"prefix": "cl",
		"body": [
			"console.log('$1');",
			"$2"
		],
		"description": "Log output to console"
	},
	"Print2 to console": {
		"prefix": "vue3",
		"body": [
			"<template>\n",

			"</template>\n",
			"<script lang=\"ts\">\n",
			"import { defineComponent } from 'vue'\n",
			"export default defineComponent({",
			"\tname:'$1'\n",
			"})",
			"</script>\n",
			"<style>\n",
			"</style>"
			
		],
		"description": "Log output to console"
	}
}

三、配置代码片段

打开配置用户代码片段
在这里插入图片描述

找到vue.json,第一次好像点击vue就可以,不用是vue.json

在这里插入图片描述

直接粘贴刚刚的代码片段

在这里插入图片描述

四、测试使用

新建index.vue
输入vue3回车即可
在这里插入图片描述

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/85179.html

(0)
小半的头像小半

相关推荐

极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!