【发布时间】:2021-12-25 16:20:13
【问题描述】:
夏天
我尝试创建一些示例 Vue Nuxt SPA。
在一个组件中,我添加了其他两个组件。
结果浏览器上什么也没有显示。
我想知道如何修复它并正确显示输入功能。
我试过的
这是目录结构。
project
├ pages
│ └ index.vue
├ components
│ ├ home
│ │ └ index.vue
│ ├ input
│ │ └ index.vue
│ └ list
│ └ index.vue
.
.
在components/home/index.vue 中我添加了两个组件:Input 和 List。
<template>
<div>
<Input/>
<List/>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator';
import Input from '~/components/input/index.vue';
import List from '~/components/list/index.vue';
@Component({
layout: 'default',
components: {
Input,
List,
},
})
export default class Home extends Vue {}
</script>
显示一些代码
这里是 Github 存储库,请查看。 https://github.com/jpskgc/vue-nuxt-spa-sample/tree/multiple-components
【问题讨论】:
-
嗨,我的回答有帮助吗?如果有,请点赞/接受。