vscode快速生成vue組件模板代碼


1、文件-->首選項-->用戶片段-->搜索vue-->點擊vue.json

2、復制以下代碼

{
    "Print to console": {
        "prefix": "vue",
        "body": [
            "<!-- $1 -->",
            "<template>",
            "<div class='page'>"
            "",
            "</div>",
            "</template>",
            "",
            "<script>",
            "export default {",
            "data() {",
            "return {",
            "",
            "};",
            "},",
            "mounted() {",
            "",
            "},",
            "methods: {",
            "",
            "},",
            "}",
            "</script>",
            "<style scoped>",
            "",
            "</style>"
        ],
        "description": "Log output to console"
    }
}
 
 
3、上面代碼中的 “prefix”: “vue”, 就是快捷鍵;保存代碼,新建vue結尾的文件,在空頁面中輸入vue,點擊回車即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM