Vue3代码模版配置(实用版)

喜欢的小伙伴点赞收藏,每次分享都需要你们的认可

添加代码模版步骤:

1.右下角设置按钮选中“用户代码片段”

2.在文件搜索框内输入"vue";并选中vue.json;回车

3.复制代码,覆盖原文件代码

{
  "Print to console": {
    "prefix": "vue3",
    "body": [
      "<script lang='ts'>",
      "import { ref,toRefs,unref,defineComponent,onBeforeMount,reactive } from 'vue'",
      "import router from '@/router/index'\n",
      "export default defineComponent({",
      "\tname:'$1',\n",
      "\tsetup() {",
      "\t\tconst state = reactive({\n",
      "\t\t})",
      "\t\treturn {\n",
      "\t\t}",
      "\t}",
      "})",
      "</script>\n",
      "",
      "<template>",
      "<div></div>",
      "</template>\n",
      "<style>",
      "</style>"
    ],
    "description": "Log output to console"
  }
}

使用:在xxx.vue文件输入“vue3”;回车,自动导入代码块

 

猜你喜欢

转载自blog.csdn.net/m0_63587743/article/details/129819493