Vue3

Vscode中快速生成Vue3模板

2022-03-07  本文已影响0人  贺大大i

步骤:设置=> 用户代码片段=> 新建vue3文件夹的代码片段

{
    "Print to console": {
        "prefix": "vue3",
        "body": [
            "<template>",
            "  <div></div>",
            "</template>",
            "",
            "<script lang='ts'>",
            "import { reactive,toRefs,onBeforeMount,onMounted} from 'vue'",
            "interface DataProps {}",

            "export default {",
            "    name: '',",
            "      setup() {",
            "          const data: DataProps = reactive({",
            "",
            "          })",
            "          onBeforeMount(() => {",
            "          })",
            "          onMounted(() => {",
            "          })",
            "          const refData = toRefs(data);",
            "          return {",
            "              ...refData,",
            "          }",
            "",
            "      }",
            "  };",
            "</script>",
            "<style scoped>",
            "</style>",
        ],
        "description": "Log output to console"
    }
}
上一篇下一篇

猜你喜欢

热点阅读