/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

import { getPropsApiByEvent } from './helper.js';
import 'lodash/camelCase';

function emitEvent(vm, eventName) {
  let emitEventName;
  let emitEventMethodName;
  if (typeof eventName === "string") {
    emitEventName = eventName;
    emitEventMethodName = getPropsApiByEvent(eventName);
  } else {
    emitEventName = eventName.event;
    emitEventMethodName = eventName.method;
  }
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  if (vm.$listeners[`${emitEventName}`]) vm.$emit(emitEventName, ...args);
  if (typeof vm.$props[emitEventMethodName] === "function") vm.$props[emitEventMethodName](...args);
}

export { emitEvent };
//# sourceMappingURL=event.js.map
