敲代码多了,发现重发动作很多,于是还是定义自动补全代码吧——懒是第一生产力!
1,Ctrl + Shift + P打开快捷命令行:找到下面这个
2,然后找到ts:
里面给了demo照着写就行
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"ref": {
"prefix": "cc",
"body": [
"const $1 = ref<$2>($3)"
]
},
"func": {
"prefix": "ff",
"body": [
"const $1 = ($2)=>{$3}"
]
}
然后重复上面的步骤 不选ts,选vue:文章来源:https://www.toymoban.com/news/detail-681104.html
"template":{
"prefix": "tt",
"body": [
"<template>",
"$1",
"</template>",
"<script lang=\"ts\" setup>",
"",
"</script>",
"<style lang=\"scss\" scoped>",
"</style>"
]
}
,后续继续添加文章来源地址https://www.toymoban.com/news/detail-681104.html
到了这里,关于vscode vue3自定义自动补全的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!