在使用vs開發vue中經常新建vue文件進行模塊開發,新建文件結構着實痛苦
於是百度配置一下自己的vs編輯器:
1.點擊vs左下角設置選擇用戶代碼片段
2.輸入vue並按下回車,將下邊代碼複製粘貼到vue.json進行保存
{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div>",
" $0",
" </div>",
"</template>",
"",
"<script>",
"",
" export default {",
" name:'',",
" props:[''],",
" data () {",
" return {",
"",
" };",
" },",
"",
" components: {},",
"",
" computed: {},",
"",
" beforeMount() {},",
"",
" mounted() {},",
"",
" methods: {},",
"",
" watch: {}",
"",
" }",
"",
"</script>",
"<style lang='' scoped>",
"",
"</style>"
],
"description": "Log output to console"
}
}
然後在新建的vue文件中輸入vue按下回車,即可