Skip to content

Commit

Permalink
fix: mixin.base-item shoud watch the item in order to reconfigure the…
Browse files Browse the repository at this point in the history
… actions (close #952)

refactor: simplify the use of attrs
  • Loading branch information
cnouguier committed Sep 20, 2024
1 parent 86a78d4 commit 62eda99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 4 additions & 7 deletions core/client/components/KDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
<Suspense>
<!-- component with v-model -->
<component
v-if="_.has(attrs, 'v-model')"
v-if="model"
ref="componentRef"
:is="computedComponent"
v-model="computedModel"
v-bind="computedProps"
v-bind="attrs"
/>
<!-- component without v-model -->
<component
v-else
ref="componentRef"
:is="computedComponent"
v-bind="computedProps"
v-bind="attrs"
/>
</Suspense>
</KModal>
Expand Down Expand Up @@ -97,7 +97,7 @@ const computedButtons = computed(() => {
const cancelButton = _.clone(props.cancelAction)
if (cancelButton.handler) {
cancelButton.handler = async () => {
// ! call the origonal handler to avoid recurcive call
// ! call the original handler to avoid recursive call
const result = await callHandler(props.cancelAction.handler)
// close dialog whatever the result of the handler
onDialogCancel(result)
Expand Down Expand Up @@ -141,9 +141,6 @@ const computedModel = computed({
emit('update:modelValue', value)
}
})
const computedProps = computed(() => {
return _.omit(attrs, ['v-model'])
})
// Functions
async function callHandler (handler) {
Expand Down
5 changes: 4 additions & 1 deletion core/client/mixins/mixin.base-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ export const baseItem = {
}
},
watch: {
// Make configured actions reactive as item actions are built from
item: function () {
this.configureActions()
},
actions: function () {
// Make configured actions reactive as item actions are built from
this.configureActions()
}
},
Expand Down

0 comments on commit 62eda99

Please sign in to comment.