fix: 处理 slot 被关闭的情况

This commit is contained in:
力皓 2021-06-04 10:24:31 +08:00
parent 29148f79f9
commit 662c9d67bd

View File

@ -355,6 +355,8 @@ export function upgradePropConfig(config: OldPropConfig, collector: ConfigCollec
let initialFn = (slotName ? null : initial) || initialValue;
if (slotName && initialValue === true) {
initialFn = (value: any, defaultValue: any) => {
// initialValue 为 true但 value 为 false / '' 等值,说明被关闭了
if (!value) return value;
if (isJSBlock(value)) {
return value;
}