1.问题原因:当前页面刷新,会关闭主页面,之后当前页面跳转到主页面并且赋值给主页面进行渲染,因为跳转过程中,赋值与页面加载同时进行,页面回流和重绘较多,可能造成资源阻塞,没有及时渲染或未渲染页面。
2.解决办法之一:
放入延时函数中赋值
//兄弟组件
import { event } from "./common/util";
setTimeout(() => {
event.$emit('getCheckBoxFlag', true); //详情页刷新时查询页面会关闭,放入延迟加载中等待查询页面加载后再赋值
}, 1000);
//兄弟组件
import { event } from "./common/util";
mounted() {
event.$on('flowInfo',res=>{
this.searchParam.evaluateStatus = res;
this.onSearch()
}).$on('getInquireClientId', clientId=>{
this.searchParam.clientId = clientId;
event.$emit('getWfListByClientIdAndTime', this.searchParam);
}).$on('getCheckBoxFlag', checkBoxFlag=>{ //接收值
this.checkBoxFlag = checkBoxFlag;
this.handleClickCheckBox();
}).$on('inquireListSearch', res=>{
this.onSearch();
})
}
//common/util/even.js
import Vue from 'vue'
export default new Vue();