/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

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

var isFunction = require('lodash/isFunction');
var isString = require('lodash/isString');
var utils_helper = require('./helper.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/slicedToArray');
require('@babel/runtime/helpers/defineProperty');
require('lodash/camelCase');
require('lodash/isUndefined');
require('lodash/isNull');
require('lodash/isArray');
require('lodash/isNumber');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var isFunction__default = /*#__PURE__*/_interopDefaultLegacy(isFunction);
var isString__default = /*#__PURE__*/_interopDefaultLegacy(isString);

function emitEvent(vm, eventName) {
  var _vm$$props;
  var emitEventMethodName;
  if (isString__default["default"](eventName)) emitEventMethodName = utils_helper.getPropsApiByEvent(eventName);
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  if (isFunction__default["default"](vm.$props[emitEventMethodName])) (_vm$$props = vm.$props)[emitEventMethodName].apply(_vm$$props, args);else vm.$emit.apply(vm, [eventName].concat(args));
}

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