提交 199862ba authored 作者: Anix's avatar Anix

修复关联文物跳转的bug

上级 ebb6ed02
...@@ -328,12 +328,17 @@ export default { ...@@ -328,12 +328,17 @@ export default {
page: null, page: null,
}; };
}, },
watch: {
'$route.params.crId'(cur) {
this.loadDetail(cur)
}
},
async mounted() { async mounted() {
this.loadDetail(); let crId = this.$route.params.crId;
this.loadDetail(crId);
}, },
methods: { methods: {
async loadDetail() { async loadDetail(crId) {
let crId = this.$route.params.crId;
if (crId) { if (crId) {
let res = await getRCDetailByIdV2({ crId }); let res = await getRCDetailByIdV2({ crId });
if (res.code == 0) { if (res.code == 0) {
...@@ -471,7 +476,7 @@ export default { ...@@ -471,7 +476,7 @@ export default {
// path: "/culturalRelic/" + crId, // path: "/culturalRelic/" + crId,
// }); // });
// window.open(newPage.href, "_blank"); // window.open(newPage.href, "_blank");
this.$router.push(`culturalRelic/${crId}`) this.$router.push(`/culturalRelic/${crId}`)
}, },
}, },
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论