【发布时间】:2020-12-28 08:18:06
【问题描述】:
我有这种情况:
父组件(Parent.vue):
<template>
........
</template>
<script>
export default {
name: 'Parent'
...........
</script
子组件(Child.vue):
<template>
........
</template>
<script>
export default {
name: 'Child'
...........
</script
为了在父组件的模板中使用子组件(子组件模板)需要做什么?步骤是什么?
【问题讨论】:
-
您将从Vue guide: Component Basic 学习如何使用。例如:在
Parent.vue中,使用<template><child></child></template> -
子组件需要先注册吗?如果有,应该怎么做?
标签: vue.js vue-component