在这个方法里 openDetailinstId var self=this; thisencryptInstIdinstIdfunctionencryptInstId let obj=self$routerresolve nameopenDoc
代码如下:
在BpmInstDetail.vue页面的script标签中添加以下代码:
export default {
// ...
created() {
// 获取instId参数
const instId = this.$route.params.instId;
// 调用openDetail方法,并传入instId参数
this.openDetail(instId);
},
methods: {
openDetail(instId) {
var self = this;
this.encryptInstId(instId, function(encryptInstId) {
let obj = self.$router.resolve({
name: 'openDoc',
params: { instId: encryptInstId },
query: { action: "detail" }
});
window.open(obj.href, "_blank");
});
},
// ...
},
// ...
};
这样在页面加载时会自动调用openDetail方法,并将instId作为参数传入
原文地址: http://www.cveoy.top/t/topic/iC90 著作权归作者所有。请勿转载和采集!