Ts+Vue3+setup语法糖 _黎先生 2022-08-05 239 阅读1分钟 1. ref import {Ref,ref} from "vue" const test1 = ref<string>("1"); const test2: Ref<string> = ref("2"); const test3 = ref<string | null>(null); const test4: Ref<string | null> = ref("2"); 2. reactive 3. props 方法一 当props没有默认值 方法二 当props有默认值或其他配置 4. inject