Jelajahi Sumber

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

Ahmad Kholid 3 tahun lalu
induk
melakukan
af9b16c5fd

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

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

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

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