Skip to content

Commit 1f81cfa

Browse files
authored
Fix vuejs#7485: consider the order of the prop types
1 parent ced00b1 commit 1f81cfa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/core/util/props.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export function validateProp (
3131
if (isType(Boolean, prop.type)) {
3232
if (absent && !hasOwn(prop, 'default')) {
3333
value = false
34-
} else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
34+
} else if (
35+
(!isType(String, prop.type) || prop.type.indexOf(String) > prop.type.indexOf(Boolean) &&
36+
(value === '' || value === hyphenate(key))
37+
) {
3538
value = true
3639
}
3740
}

0 commit comments

Comments
 (0)