소스 검색

feat: 移动端标讯收藏留资跳转前缓存页面数据

cuiyalong 1 년 전
부모
커밋
4ad0f1bf1f
2개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 1
      apps/mobile/src/views/article/components/ActionCollection.vue
  2. 6 1
      apps/mobile/src/views/article/components/TabActions.vue

+ 3 - 1
apps/mobile/src/views/article/components/ActionCollection.vue

@@ -84,7 +84,9 @@ export default {
         status: this.value,
         id: this.id,
         beforeRedirect: async () => {
-          await this.beforeRedirect()
+          if (_this.beforeRedirect) {
+            await _this.beforeRedirect()
+          }
         },
         cancel() {
           _this.syncLabels([])

+ 6 - 1
apps/mobile/src/views/article/components/TabActions.vue

@@ -1,6 +1,11 @@
 <template>
   <section class="tab-actions safe-area-inside-bottom bg-white">
-    <ActionCollection class="tab-action" :id="id" @syncLabels="syncLabels" />
+    <ActionCollection
+      class="tab-action"
+      :id="id"
+      @syncLabels="syncLabels"
+      :beforeRedirect="beforeLeavePage"
+    />
     <QuickMonitor
       class="tab-action"
       :id="id"