vscode快速生成一个vue模板

1  在文件->首选项->用户片段 调出搜索框 然后输入 vue 会生成一个 json文件 把下面代码输入进去即可 其中 prefix 就是输入的快捷键的名称

 {
        // 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"
        }
    }
复制代码
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享