Browse Source

fix: white screen after submitting schedule

Casper Dai 3 years ago
parent
commit
2594c9c87a

+ 3 - 2
src/components/Schedule/index.vue

@@ -83,9 +83,10 @@ export default {
 
     return h(component, {
       props: {
-        detail: detail,
+        detail,
         ...this.$attrs
-      }
+      },
+      on: this.$listeners
     })
   }
 }

+ 1 - 1
src/components/Schedule/mixins/schedule.js

@@ -47,7 +47,7 @@ export default {
     },
     submit () {
       submitSchedule(this.scheduleOptions, this.programs).then(() => {
-        this.$router.replace({ name: 'schedule' })
+        this.$emit('submit')
       })
     }
   }

+ 6 - 0
src/views/schedule/designer/index.vue

@@ -9,6 +9,7 @@
       class="l-flex__auto"
       :schedule="scheduleId"
       editable
+      @submit="onSubmit"
     />
   </wrapper>
 </template>
@@ -25,6 +26,11 @@ export default {
     scheduleId () {
       return this.$route.params.id
     }
+  },
+  methods: {
+    onSubmit () {
+      this.$router.replace({ name: 'schedule-list' })
+    }
   }
 }
 </script>