Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问在根目录下有一个index.html 里面有<router-view></router-view>这个,在App.vue这个文件里面也有<router-view></router-view> #47

Closed
limeiyan1 opened this issue Dec 4, 2017 · 3 comments

Comments

@limeiyan1
Copy link

请问在根目录下有一个index.html 里面有这个,在App.vue这个文件里面也有也有这个,为什么这2个文件都要有这句,我看vue-cli的项目只有在App.vue里面才有。。麻烦解答下,谢谢

@bailicangdu
Copy link
Owner

版本不一样,新版没有了

@GrowingFun
Copy link

GrowingFun commented May 4, 2018

这是嵌套路由
index.html 中的 router-view, 显示的是 App(/),
App 中的 router-view 显示的是 home,item,score等子组件
将App修改为

<div>
    <h2 style="color: red;">app</h2>
    <router-view></router-view>
</div>

效果更明显
@limeiyan1

@chaihongjun
Copy link

我把index.html 里面的去掉了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@chaihongjun @GrowingFun @bailicangdu @limeiyan1 and others