參考:
https://www.cnblogs.com/ainyi/p/9340311.html
https://blog.csdn.net/weixin_41888813/article/details/86735664
created() { this.fetchLink() }, watch: { // 監聽相同路由下參數變化的時候,從而實現異步刷新 '$route'(to,from) { // 做一些路由變化的響應 this.loading = true; this.fetchLink() } }, methods: { fetchLink(){ resourcemgApi.zypriceSearch(this.$route.params.name).then(resp => [ this.list = resp.data, console.log(this.list) ]) } },