ctrl+shift+p -> 輸入snippet -> 首選項:配置用戶代碼片段 -> 輸入vue -> 選擇vue.json(vue)
輸入:
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div>\n",
" </div>",
"</template>\n",
"<script>",
"export default {",
" data () {",
" return {\n",
" }",
" },",
" methods: {\n",
" },",
" components: {\n",
" }",
"}",
"</script>\n",
"<style scoped>\n",
"</style>",
"$2"
],
"description": "創建一個自定義的vue組件代碼塊"
}
創建測試文件: