Skip to content

Commit

Permalink
fix: flush internal model in the last
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jul 27, 2023
1 parent dec8b2a commit 7c5e2f8
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/checkbox/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ watchEffect(() => {
} else {
internalChecked = checked
}
})
}, { flush: 'post' })
watch($$(internalChecked), currentValue => {
if (typeof multiple === 'boolean') {
Expand Down
2 changes: 1 addition & 1 deletion src/details/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let internalOpen = $ref(open)
watchEffect(() => {
internalOpen = open
})
}, { flush: 'post' })
function toggle(event: Event) {
internalOpen = (event.target as HTMLDetailsElement).open
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let internalOpen = $ref(open)
watchEffect(() => {
internalOpen = open
})
}, { flush: 'post' })
watch($$(internalOpen), currentValue => {
emit('update:open', currentValue)
Expand Down
2 changes: 1 addition & 1 deletion src/input/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ let internalModelValue = $ref(modelValueText)
watchEffect(() => {
internalModelValue = modelValueText
})
}, { flush: 'post' })
watch($$(internalModelValue), currentValue => {
const value = currentValue !== undefined && modelModifiers.number
Expand Down
2 changes: 1 addition & 1 deletion src/popover/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let internalOpen = $ref(open)
watchEffect(() => {
internalOpen = open
})
}, { flush: 'post' })
watch($$(internalOpen), currentValue => {
emit('update:open', currentValue)
Expand Down
2 changes: 1 addition & 1 deletion src/rate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let internalModelValue = $ref(modelValue)
watchEffect(() => {
internalModelValue = modelValue
})
}, { flush: 'post' })
watch($$(internalModelValue), currentValue => {
emit('update:modelValue', currentValue)
Expand Down
2 changes: 1 addition & 1 deletion src/select/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ let internalModelValue = $ref(defaultModelValue)
watchEffect(() => {
internalModelValue = defaultModelValue
})
}, { flush: 'post' })
watch($$(internalModelValue), currentValue => {
emit('update:modelValue', currentValue)
Expand Down
2 changes: 1 addition & 1 deletion src/slider/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let internalModelValue = $ref(modelValue)
watchEffect(() => {
internalModelValue = round(modelValue)
})
}, { flush: 'post' })
watch($$(internalModelValue), currentValue => {
emit('update:modelValue', currentValue)
Expand Down
2 changes: 1 addition & 1 deletion src/switch/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let internalModelValue = $ref(modelValue)
watchEffect(() => {
internalModelValue = modelValue
})
}, { flush: 'post' })
watch($$(internalModelValue), currentValue => {
emit('update:modelValue', currentValue)
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let internalModelValue = $ref(modelValue) as typeof modelValue
watchEffect(() => {
internalModelValue = modelValue
})
}, { flush: 'post' })
watch($$(internalModelValue as RefValue<typeof modelValue>), currentValue => {
emit('update:modelValue', currentValue)
Expand Down
2 changes: 1 addition & 1 deletion src/toast/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let internalOpen = $ref(open)
watchEffect(() => {
internalOpen = open
})
}, { flush: 'post' })
watchEffect(onInvalidate => {
if (internalOpen && Number.isFinite(duration)) {
Expand Down

0 comments on commit 7c5e2f8

Please sign in to comment.