Skip to content

Commit 9e79ff7

Browse files
committed
fix: the initial local prop mode is not synchronized with the global one
1 parent de0d50d commit 9e79ff7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ export default defineComponent({
8989
const initialMode = conclude([props.mode, globalProps.mode], {
9090
type: String as PropType<Mode>,
9191
})
92+
if (globalProps.mode !== undefined && props.mode === undefined) {
93+
// will trigger watch
94+
onChangeMode(globalProps.mode)
95+
}
9296
const initialValue = conclude([props[modelValueProp], globalProps[modelValueProp]])
9397
const initialBoolAttrs = Object.fromEntries(
9498
Array.from(boolAttrs, boolAttr => [boolAttr, conclude([props[boolAttr], globalProps[boolAttr]])]).filter(

0 commit comments

Comments
 (0)