公告
财富商城
积分规则
提问
发文
2019-01-21 15:49发布
太酷不给撩
Just a quick question.
Can you force Vue.js to reload/recalculate everything? If so, how?
Try to use this.$router.go(0); to manually reload the current page.
this.$router.go(0);
Sure .. you can simply use the key attribute to force re-render (recreation) at any time.
<mycomponent :key="somevalueunderyourcontrol"></mycomponent>
See https://jsfiddle.net/mgoetzke/epqy1xgf/ for an example
It was also discussed here: https://github.com/vuejs/Discussion/issues/356#issuecomment-336060875
最多设置5个标签!
Try to use
this.$router.go(0);
to manually reload the current page.Sure .. you can simply use the key attribute to force re-render (recreation) at any time.
<mycomponent :key="somevalueunderyourcontrol"></mycomponent>
See https://jsfiddle.net/mgoetzke/epqy1xgf/ for an example
It was also discussed here: https://github.com/vuejs/Discussion/issues/356#issuecomment-336060875