panthro Asked: 2024-10-10 03:47:24 +0800 CST 从子组件获取父组件中的计算对象? 5 我在子组件中有一个对象,类似于: const obj = computed(() => ({ abc: someField.value, xyz: anotherField.value, })); 在父级中我想获取这个对象,我该怎么做? vue.js
panthro Asked: 2023-08-30 22:41:13 +0800 CST 键入 v-for 循环? 6 文档说: 在 Vue 3.x 中,键应该放在标签上。 <template v-for="item in list" :key="item.id"> <div>...</div> <span>...</span> </template> 但我希望使用索引作为我的密钥,所以我这样做: <template v-for="(item, index) in props.items" :key="index"> 但我收到了警告index is declared but never read。 怎么修? vuejs3