Skip to content

Commit

Permalink
fix: the initial local prop mode is not synchronized with the globa…
Browse files Browse the repository at this point in the history
…l one
  • Loading branch information
cloydlau committed Apr 13, 2024
1 parent de0d50d commit 9e79ff7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export default defineComponent({
const initialMode = conclude([props.mode, globalProps.mode], {
type: String as PropType<Mode>,
})
if (globalProps.mode !== undefined && props.mode === undefined) {
// will trigger watch
onChangeMode(globalProps.mode)
}
const initialValue = conclude([props[modelValueProp], globalProps[modelValueProp]])
const initialBoolAttrs = Object.fromEntries(
Array.from(boolAttrs, boolAttr => [boolAttr, conclude([props[boolAttr], globalProps[boolAttr]])]).filter(
Expand Down

0 comments on commit 9e79ff7

Please sign in to comment.