在我新创建的next专案组,好像有奇怪的事发生。每当我去项目的根,例如:localhost:3000
似乎没有渲染。但是当我去例如:localhost:3000/index
它确实渲染正确的index.vue
文件。
项目结构为:
components
-Hero.vue
layouts
-default.vue
-error.vue
pages
-index.vue
-About.vue
-Contact.vue
索引。vue包含
<template>
<main>
<Hero />
</main>
</template>
<script>
export default {
}
</script>
<style lang="scss">
</style>
default.vue:
<template>
<div>
<MainHeader />
<Nuxt />
<Footer />
</div>
</template>
<style lang="scss">
@import "../assets/scss/main.scss";
</style>
我的目标是使它渲染index.vue
文件,希望有人能帮助我
如果你正在使用App.vue:尝试使用<NuxtPage />
查看此处下一页