关于 props 的问题
来源:13-10 List 案例

Richard学python
2023-08-19
以下两种对父组件传过来的数据,在这个案例种处理有什么不同,第二种方法是不是更简洁些,直接遍历即可,效果一样?为什么要用 ref 重新处理一遍?
const props = defineProps({
itemList: {
type: Array,
},
});
const itemList = ref(props.itemList);
defineProps({
itemList: {
type: Array,
},
});
写回答
1回答
-
coder_monkey
2023-08-19
定义组建自身的状态
00
相似问题