-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Bug report] Vuepress cannot use Responsive sidebar & navbar in Vue 3.4 or higher #27
Comments
Mutiple vue version situation may caused by reproduction when running And you can check the reproduction again. |
感谢,终于解决了这个问题,安装了 vue 3.3.13版本(npm install [email protected] --save-dev),之前默认是安装 3.4版本,这个问题我研究了挺久的,一直没发现是 vue 版本问题 |
@meteorlxy CC, I also encountered some issue when upgrading to Vue3.4 now, we need to make new versions to land to fix this problem.
|
@meteorlxy I managed to figure out how this happens, in Vue3.4 the reactivity system is rewritten. See https://blog.vuejs.org/posts/vue-3-4#more-efficient-reactivity-system. We previously called composition Api hooks like This issue could be solved by moving out the router and route declarations outside the // before
const sidebar = computed(() =>
resolveSidebar() // called useRouter and useRoute inside it
)
// after
const router = useRouter()
const route = useRoute()
const sidebar = computed(() =>
resolveSidebar(router, route)
) I am not sure if this should be the correct fix, but the change is valid and the direction should be correct. Vue3.4 does have different activity with composition api calls inside computed getter functions. May need you take a deeper look at this. |
Description
When I use vue 3.4.0 and then run
pnpm docs:dev
, and then open my local vuepress site, the navbar and sidebar will lose their responsive capability.当我用 vue 3.4.0 并且运行
pnpm docs:dev
,再打开本地的 Vuepress 网页时,顶部导航和侧边栏都会失去它们的响应性。The guide in guide of vuepress tells me to install vue normally like
pnpm add -D vue
在官方文档中提到的方法,只是简单地让我直接安装 vue——
pnpm add -D vue
This situation is the same in higher version (3.4.14, which is the lastest version)
同样的情况(指失去响应性)当然也发生在了更高版本。
However, if i install vue 3.3.13 like the official documents do, it will run responsively.
然而,如果我像官方文档里写的一样,为我的 vuepress 安装 vue 3.3.13,又可以成功运行了。
This problem may caused by the update of vue 3.4, which added some breaking features.
这可能是因为 vue3.4 的更新带来了一些新特性。
Reproduction
https://github.com/LdoDoeg222/vuepress-bugrepo
Used Package Manager
pnpm
System Info
The text was updated successfully, but these errors were encountered: