1.使用快捷Ctrl + Shift + P喚出控制臺

2,然后輸入“snippets”并選擇

2.接著輸入vue,

vs code自動生成vue.json檔案,

3. 將vue.json檔案改為下面得模板(可以根據個人需求修改當中的模板內容)

{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div">$0</div>",
"</template>",
"",
"<script>",
"export default {",
" components: {},",
" props: {},",
" data() {",
" return {",
" };",
" },",
" watch: {},",
" computed: {},",
" methods: {},",
" created() {},",
" mounted() {}",
"};",
"</script>",
"<style lang=\"scss\" scoped>",
"</style>"
],
"description": "A vue file template"
}
}

然后新建一個 vue 檔案,輸入“vue”,按下回車鍵或者Tab鍵,模板就自動生成了:

轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/287396.html
標籤:其他
上一篇:別錯過這個ssm前后端分離專案
下一篇:【JavaScript】基礎語法
