【发布时间】:2017-09-15 12:29:58
【问题描述】:
美好的一天! 请大神告诉我如何在nuxt js中使用嵌套组件?
// ~/components/general/Page.vue
<template lang="pug">
div(id="page" class="align-center")
</template>
// ~/components/general/Header.vue
<template lang="pug">
header
div(class="align-center align-middle")
img(src="~/assets/general/header/logo.png")
</template>
// pages/index.vue
<template lang="pug">
div
page
test
</template>
<script>
import page from '~/components/general/Page.vue'
import test from '~/components/general/Header.vue'
export default {
components: {
page,
test
}
}
</script>
因此这种设计不起作用。 有什么必要让它赚到? 举个例子不胜感激
我尝试使用父组件中的插槽,但仍然无法使用它
// ~/components/general/Page.vue
<template lang="pug">
div(id="page" class="align-center")
slot
</template>
【问题讨论】:
标签: nuxt.js