We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbd4786 commit 30c2832Copy full SHA for 30c2832
packages/vue-final-modal/src/components/CoreModal/useModelValue.ts
@@ -28,19 +28,19 @@ export function useModelValue(
28
*/
29
function setModelValueLocal(val: boolean) {
30
const success = val ? open() : close()
31
- if (success)
+ if (success) {
32
_modelValueLocal.value = val
33
- else
+ if (val !== props.modelValue)
34
+ emit('update:modelValue', val)
35
+ }
36
+ else {
37
emit('update:modelValue', !val)
38
39
}
40
41
watch(() => props.modelValue, (val) => {
42
modelValueLocal.value = !!val
43
})
- watch(modelValueLocal, (val) => {
- if (val !== props.modelValue)
- emit('update:modelValue', val)
- })
44
45
return {
46
modelValueLocal,
0 commit comments