vscode 设置自定义文件 .vue

1,安装Vetur

 

 

 2,新建用户片段

  *文件扩展名.json

 

 

 

 

3,编写新模板

  *vue3为 关键字

{
  "Print to console": {
    "prefix": "vue3",
    "body": [
      "<!-- $1 -->",
      "<template>",
      "  <div class='$2'>$5</div>",
      "</template>",
      "",
      "<script>",
      "export default {",
      "  components: {},",
      "  data() {",
      "    return {}",
      "  },",
      "  computed: {},",
      "  watch: {},",
      "  methods: {},",
      "  created() {},",
      "  mounted() {},",
      "}",
      "</script>",
      "<style scoped>",
      "$4",
      "</style>"
    ],
    "description": "Log output to console"
  }
}

 4,新建.vue文件,输入关键词,可以看到新追加的模板

 

posted @ 2021-04-15 23:05  容我看看这世界啊  阅读(126)  评论(0)    收藏  举报