VScode快速生成vue3代码模板

VScode快速生成vue3代码模板

提示:以下是本篇文章正文内容,下面案例可供参考

一、如何创建模板

  1. 首先在VScode编辑器中打开,【文件】–>【首选项】–>【用户片段】–>【新代码片段】–> 取名vue.json 确定
  2. 把下列代码放进去

    {
      // Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and
      // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
      // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
      // same ids are connected.
      // Example:
      // "Print to console": {
      //  "prefix": "log",
      //  "body": [
      //    "console.log('$1');",
      //    "$2"
      //  ],
      //  "description": "Log output to console"
      // }
      "Print to console": {
     "prefix": "vue3",
     "body": [
       "",
       "",
       "",
       ""
     ],
     "description": "Log output to console"
      }
    }

    二、如何使用模板

  3. 新建vue页面,在文章中输入vue3后,点击回车即可
    VScode快速生成vue3代码模板_第1张图片
    VScode快速生成vue3代码模板_第2张图片

你可能感兴趣的:(VScode快速生成vue3代码模板)