Open any86 opened 2 years ago
interface Props { modelValue: KV; items?: Item[]; } const props = withDefaults(defineProps<Props>(),{ // 🔥 问题就出在这里 ↓ modelValue:{}, });
不要忘记了引用型数据作为默认值, 要嵌套一层函数, 修改为:
const props = withDefaults(defineProps<Props>(),{ modelValue:()=>({}), });
不要忘记了引用型数据作为默认值, 要嵌套一层函数, 修改为: