I am using Quasar framework. And would like to add a 3rd argument on the framework component's preset.
This is for Q-popup-edit's save / cancel events:
Syntax:
@save -> function(value, initialValue)
Description
Emitted when value has been successfully validated and it should be saved
Parameters:
value - Validated value to be saved
initialValue - Initial value, before changes
Is there a way so that I do not have to specify the 'new' and 'old' value and just pass in my 3rd argument?
@save="saved(.., .., arg3)" or something like @cancel="canceled(arg3)". If that is not possible, then how can I pass the initial and new values?
<q-popup-edit buttons lazy-rule v-model="props.row.value" @save=(newValue, initialValue, arg3)?
...
methods: {
saved (val, initialValue, arg3) {
console.log(`original value = ${initialValue}, new value = ${val}`)
console.log('argument3 = ' + arg3)
},
canceled (val, initialValue, arg3) {
console.log(`retain original value = ${initialValue}, canceled value = ${val}`)
console.log('argument3 = ' + arg3)
}
}
...
Quasar Q-popup-edit documentation: https://quasar.dev/vue-components/popup-edit
You can achieve this.
example -
@filter="(val,update,abort) => yourFilterFn(val,update,abort,yourCustomParam)"
@save="(newValue, initialValue) => yourFilterFn(newValue,initialValue,third_argument)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With