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

场景切换器SceneSwitcher组件的按钮激活未切换 #18

Open
XiaofengZeng opened this issue Mar 18, 2022 · 1 comment · Fixed by #23
Open

场景切换器SceneSwitcher组件的按钮激活未切换 #18

XiaofengZeng opened this issue Mar 18, 2022 · 1 comment · Fixed by #23
Labels
bug Something isn't working

Comments

@XiaofengZeng
Copy link
Owner

description:

进入系统后,使用URL进行路由组件切换(主要是切换不同的场景),但场景切换器SceneSwitcher组件的场景按钮激活状态没有切换到路由对应的按钮上。需要二次访问URL才能切换。

speculation:
场景切换器SceneSwitcher组件进行激活状态切换是在组件mounted生命周期中,在第一次使用URL进行路由组件切换时,并没有重新将组件进行mounted,因此没有效果。

question:
如何在使用URL进行路由组件跳转时切换该组件中的activatedScene属性?

@XiaofengZeng
Copy link
Owner Author

在PR#23中完成问题的修复

思路:
在展示界面Main组件中,添加beforeUpadte生命周期函数,使得在路由进行切换、Main主要更新时,能够对路由进行判断,进而设置Vuex中的currentScene属性,最终能够使场景切换器SceneSwitcher组件能够响应式修改按钮的高亮样式

@XiaofengZeng XiaofengZeng added the bug Something isn't working label Mar 22, 2022
@XiaofengZeng XiaofengZeng linked a pull request Mar 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant