为了启动nuxt3项目,我遵循基本教程:
cd /myfolder
yarn init -y
yarn add --dev nuxt3
yarn nuxi create nuxt3-app
cd nuxt3-app
yarn install
yarn dev -o然后我删除app.vue。
我创建目录:
mkdir components pages layouts和档案:
touch components/Header.vue
touch pages/index.vue
touch layouts/default.vue// components/Header.vue
<template>
<div>
HEADER
</div>
</template>// pages/index.vue
<template>
<div>
INDEX
</div>
</template>// layouts/default.vue
<template>
<div>
<Header />
<slot />
</div>
</template>但是,不包括Header组件。如果我连接到http://localhost:3000,我只会看到单词INDEX。
我做错什么了?
我遵循了关于正式文档的教程:
https://v3.nuxtjs.org/getting-started/installation
https://v3.nuxtjs.org/docs/directory-structure/components/
Nuxt project info:
------------------------------
- Operating System: `Linux`
- Node Version: `v16.13.1`
- Nuxt Version: `3.0.0-27459267.f69126e`
- Package Manager: `yarn@1.22.17`
- Builder: `vite`
- User Config: `-`
- Runtime Modules: `-`
- Build Modules: `-`
------------------------------发布于 2022-03-18 14:19:03
https://stackoverflow.com/questions/71525661
复制相似问题