我想将数据传递给子组件并在父组件中呈现相同的数据。此外,我想在函数中使用数据,而不是简单地将其呈现在子进程中。当我在这个例子中传递道具时,它不再呈现
带有数据的标签
<template>
<div class="hello">
<div v-for="(section, index) in sections" :key="index">
<p>{{section.name}}</p>
<p>{{section.type}}</p>
</div>
</div>
</template>
<script>
export default {
name: "HelloWorld",
data() {
return {
sections: [
{
name: "scoop",
type: "boulder"
},
{
name: "pew pew",
type: "roped"
}
]
};
},
props: ["sections"]
};
</script>