关于 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

定义组建自身的状态

0
0

Vue3+Uni+Node+MySQL 从零实现跨端小程序的全栈应用

小程序、 Vue3、Uni、NodeJs,全新300+技术点,实现跨端全栈应用

274 学习 · 155 问题

查看课程