element-plus
Version:
A Component Library for Vue 3
18 lines (15 loc) • 413 B
JavaScript
import { unref } from 'vue';
import { isArray } from '@vue/shared';
const isTriggerType = (trigger, type) => {
if (isArray(trigger)) {
return trigger.includes(type);
}
return trigger === type;
};
const whenTrigger = (trigger, type, handler) => {
return (e) => {
isTriggerType(unref(trigger), type) && handler(e);
};
};
export { isTriggerType, whenTrigger };
//# sourceMappingURL=utils.mjs.map