You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
448 B
19 lines
448 B
|
2 years ago
|
import { unref } from 'vue';
|
||
|
|
import '../../../utils/index.mjs';
|
||
|
|
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
|