編輯本身的代碼片斷
-
ctrl+shift+pvue
-
輸入snippetjson
-
選擇 'Preferences: Configure User Snippets'less
-
輸入vuespa
-
選擇vue.json,會打開vue.json文件code
-
在文件中輸入如下代碼component
{ "vue-template": { "prefix": "vue", "body": [ "<template>", " <div class=\"\">", "", " </div>", "</template>", "", "<script>", "export default {", " name: '',", " data() { ", " return {", "", " }", " },", " props: {", "", " },", " components:{", " },", " mounted() {", "", " },", " methods:{", "", " },", " }", "</script>", "", "<style lang=\"less\" scoped>", " .$1{", "", " }", "</style>" ], "description": "my vue template" } }
使用代碼片斷
- 新建vue文件
- 打開剛剛新建的vue文件
- 輸入vue,會有提示,回車便可