Skip to content

How to use clientAppRootComponentFiles only apply to file README.md #404

Answered by Mister-Hope
zenkiet asked this question in Q&A
Discussion options

You must be logged in to vote

What's the actual problem???

Add a v-if directive on the root element of your component. The v-if should be similar like $route.path.endsWith('/') || $route.path.endsWith('/index.html')

Also, in your setup funciton, remove any changes when route changed to a page not generated by README.md, and apply back if so.

I think this is totally a vue problem, and I am not sure if coding questions unrelated to vuepress api should be posted here. Maybe you should try discord, stackoverflow or other places.

In a word, all you needed to do is to add a wrapper outside your current component, which only activite it when routes changed to / or /index or /index.html.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Mister-Hope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants