mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 12:07:54 +08:00
fix: function default value
This commit is contained in:
parent
0935262334
commit
8d2d659d6f
@ -81,8 +81,10 @@ export const withDefault = function(type) {
|
||||
warn(`${this._vueTypes_name} - invalid default value: "${def}"`, def);
|
||||
return this;
|
||||
}
|
||||
|
||||
// isFunction(def) 关注 https://github.com/vuejs/vue-next/pull/1291 合并发版本后可删除
|
||||
this.default =
|
||||
isArray(def) || isPlainObject(def)
|
||||
isArray(def) || isPlainObject(def) || isFunction(def)
|
||||
? function() {
|
||||
return def;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ const AffixProps = {
|
||||
/** 固定状态改变时触发的回调函数 */
|
||||
// onChange?: (affixed?: boolean) => void;
|
||||
/** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
|
||||
target: PropTypes.func.def(() => getDefaultTarget),
|
||||
target: PropTypes.func.def(getDefaultTarget),
|
||||
prefixCls: PropTypes.string,
|
||||
};
|
||||
const AffixStatus = {
|
||||
|
Loading…
Reference in New Issue
Block a user