vue3之跳转页面时判断是否跳转
vue3之跳转页面时判断是否跳转
onBeforeRouteLeave((to, from, next) => ( if (ruleAllChange .value){ ElMessageBoxconfirm( "数据未保存,请问是否继续跳转?", "确认" {confirmButtonText:"确认',cancelButtonText:取消'type: "warning”} ).then(() => { next(); // 继续跳转 .catch(() => [ // 不跳转 } else { next(); } })
钻研不易,转载请注明出处......