/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var utils_helper = require('./helper.js');
require('lodash/camelCase');

function emitEvent(vm, eventName) {
  let emitEventName;
  let emitEventMethodName;
  if (typeof eventName === "string") {
    emitEventName = eventName;
    emitEventMethodName = utils_helper.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);
}

exports.emitEvent = emitEvent;
//# sourceMappingURL=event.js.map
