hookehuyr

🐞 fix: 成功页显示信息改成从上一个页面获取

1 <!-- 1 <!--
2 * @Date: 2022-07-18 10:22:22 2 * @Date: 2022-07-18 10:22:22
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-09 14:54:36 4 + * @LastEditTime: 2024-10-16 16:42:21
5 * @FilePath: /data-table/src/views/index.vue 5 * @FilePath: /data-table/src/views/index.vue
6 * @Description: 首页 6 * @Description: 首页
7 --> 7 -->
...@@ -943,6 +943,9 @@ const successHandle = () => { // 表单成功提交后续操作 ...@@ -943,6 +943,9 @@ const successHandle = () => { // 表单成功提交后续操作
943 // 跳转成功页面 943 // 跳转成功页面
944 $router.push({ 944 $router.push({
945 path: "/success", 945 path: "/success",
946 + query: {
947 + successInfo: JSON.stringify(successInfo.value),
948 + },
946 }); 949 });
947 } 950 }
948 } 951 }
......
1 <!-- 1 <!--
2 * @Date: 2022-06-29 18:18:02 2 * @Date: 2022-06-29 18:18:02
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-02-16 16:41:15 4 + * @LastEditTime: 2024-10-16 16:46:34
5 * @FilePath: /data-table/src/views/success.vue 5 * @FilePath: /data-table/src/views/success.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -56,12 +56,14 @@ const styleObj = { ...@@ -56,12 +56,14 @@ const styleObj = {
56 56
57 // 获取成功返回信息 57 // 获取成功返回信息
58 const store = mainStore(); 58 const store = mainStore();
59 -const { successInfo } = storeToRefs(store); 59 +// const { successInfo } = storeToRefs(store);
60 +const successInfo = ref({});
60 61
61 const richText = '<div style="font-weight: bold;">123</div>' 62 const richText = '<div style="font-weight: bold;">123</div>'
62 63
63 onMounted(() => { 64 onMounted(() => {
64 $('body').css('backgroundColor', 'white'); 65 $('body').css('backgroundColor', 'white');
66 + successInfo.value = JSON.parse($route.query.successInfo)
65 }); 67 });
66 68
67 const handle = () => { 69 const handle = () => {
......