瀏覽代碼

fix: cancelable and bubbles options value got deleted when changed the trigger event

Ahmad Kholid 3 年之前
父節點
當前提交
af9b16c5fd
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 3 3
      src/components/newtab/workflow/edit/EditTriggerEvent.vue
  2. 1 1
      src/newtab/pages/Home.vue

+ 3 - 3
src/components/newtab/workflow/edit/EditTriggerEvent.vue

@@ -4,7 +4,7 @@
       :model-value="data.eventName"
       class="w-full mt-2"
       placeholder="Select an event"
-      @change="handleEventChange"
+      @change="handleSelectChange"
     >
       <option v-for="event in eventList" :key="event.id" :value="event.id">
         {{ event.name }}
@@ -41,7 +41,7 @@
           :is="componentName"
           v-if="componentName"
           :params="params"
-          @update="updateParams"
+          @update="updateParams({ ...params, ...$event })"
         />
       </div>
     </transition-expand>
@@ -95,7 +95,7 @@ function updateParams(value) {
   params.value = value;
   updateData({ eventParams: value });
 }
-function handleEventChange(value) {
+function handleSelectChange(value) {
   const eventType = eventList.find(({ id }) => id === value).type;
   const payload = { eventName: value, eventType };
 

+ 1 - 1
src/newtab/pages/Home.vue

@@ -9,8 +9,8 @@
           </p>
           <workflow-card
             v-for="workflow in workflows"
-            v-bind="{ workflow }"
             :key="workflow.id"
+            :workflow="workflow"
             :show-details="false"
             @execute="executeWorkflow"
           />