mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-11 00:06:06 +08:00
21 lines
532 B
TypeScript
21 lines
532 B
TypeScript
import { filterEmpty } from '../_util/props-util';
|
|
const isValid = (value: any) => {
|
|
return (
|
|
value !== undefined &&
|
|
value !== null &&
|
|
(Array.isArray(value) ? filterEmpty(value).length : true)
|
|
);
|
|
};
|
|
|
|
export function hasPrefixSuffix(propsAndSlots: any) {
|
|
return (
|
|
isValid(propsAndSlots.prefix) ||
|
|
isValid(propsAndSlots.suffix) ||
|
|
isValid(propsAndSlots.allowClear)
|
|
);
|
|
}
|
|
|
|
export function hasAddon(propsAndSlots: any) {
|
|
return isValid(propsAndSlots.addonBefore) || isValid(propsAndSlots.addonAfter);
|
|
}
|