0
点赞
收藏
分享

微信扫一扫

vue3代码片段模版与VSCode设置

一、前言

我们在使用​​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"
}
}

三、配置代码片段

打开配置用户代码片段
vue3代码片段模版与VSCode设置_sed

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

vue3代码片段模版与VSCode设置_代码片段_02

直接粘贴刚刚的代码片段

vue3代码片段模版与VSCode设置_vscode_03

四、测试使用

新建​​index.vue​​​ 输入​​vue3​​回车即可
vue3代码片段模版与VSCode设置_代码片段_04


举报

相关推荐

0 条评论