How to use clientAppRootComponentFiles only apply to file README.md #404
-
I have reference to the following command clientAppRootComponentFiles: path.resolve(__dirname, './path/to/RootComponent.vue'), but it will apply to *.md, I just want to apply to all README.md file |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What's the actual problem??? Add a 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 |
Beta Was this translation helpful? Give feedback.
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
.