Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
964 views
in Technique[技术] by (71.8m points)

vuex 里如何拿到路由进行操作?

场景是这样的,我登陆的时候我对路由进行了 addRoutes 操作。但退出后我要把追加进去的路由给删除掉。
退出的时候我写了个 actions 方法因为多个地方有调用 退出 actions .所以想把删除原路由的写到 actions 但我怎么拿路由里面都拿不到! 想请教下如何在 actions 里操作路由且还生效。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

官方的插件, 通过vuex操作route
https://github.com/vuejs/vuex... 里面倒没有封装addRoutes操作, 不过可以看看他的思路自己写


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...