dengrui 9 tháng trước cách đây
mục cha
commit
364f999fa2
1 tập tin đã thay đổi với 15 bổ sung3 xóa
  1. 15 3
      src/layout/components/header.vue

+ 15 - 3
src/layout/components/header.vue

@@ -83,9 +83,8 @@ import dayjs from "dayjs";
 import type { DropdownInstance } from "element-plus";
 import { logoutApi } from "@/api/auth";
 import { useUserStore } from "@/store";
-
+import { ElMessage, ElMessageBox } from "element-plus";
 const userStore = useUserStore();
-
 const router = useRouter();
 const route = useRoute();
 const routeMeta = computed(() => {
@@ -132,7 +131,20 @@ const showClick = () => {
 };
 
 const commonBack = (itemValue) => {
-  router.back();
+  //包含弹框逻辑
+  if (route.fullPath.split("/")[1] == "pro-steps") {
+    ElMessageBox.confirm("确认是否要回退?", "警告", {
+      confirmButtonText: "确认",
+      cancelButtonText: "取消",
+      type: "warning",
+    })
+      .then(() => {
+        router.back();
+      })
+      .catch(() => {});
+  } else {
+    router.back();
+  }
 };
 
 const handleCommand = (command: string | number | object) => {