方法一:配置用戶代碼片段
好處:可以完全按照個(gè)人習(xí)慣設(shè)置。
1、打開(kāi)設(shè)置里的用戶代碼片段
2、找到vue.json
3、配置如下:
// Example:
"vue代碼段": {
"prefix": "vue",
"body": [
"<script setup lang=\"ts\"></script>",
"<template></template>",
"<style scoped></style>"
],
"description": "a vue template"
}
4、使用:輸入vue回車生成
方法二:使用Vue VSCode Snippets插件
好處:安裝即用,生成默認(rèn)模板。
1、下載Vue VSCode Snippets插件并啟用
2、使用:輸入vue回車生成
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-630421.html
總結(jié):兩種方法根據(jù)個(gè)人喜好使用,也可同時(shí)使用。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-630421.html
到了這里,關(guān)于VScode快速生成Vue3組件模板(代碼片段&插件)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!