vs code 快速生成vue 模板


1.使用快捷Ctrl + Shift + P喚出控制台,然后輸入snippets並選擇。(或 文件>首選項>用戶代碼片斷里面,輸入 vue.json ,然后回車 )(或 file > Preferences > User Snippets,然后回車)

 

2.接着輸入vue,選擇vue-html.json文件,把代碼粘貼上去

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


免責聲明!

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



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