submenu.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 129);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 0:
  90. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91. "use strict";
  92. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  93. /* globals __VUE_SSR_CONTEXT__ */
  94. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  95. // This module is a runtime utility for cleaner component module output and will
  96. // be included in the final webpack user bundle.
  97. function normalizeComponent (
  98. scriptExports,
  99. render,
  100. staticRenderFns,
  101. functionalTemplate,
  102. injectStyles,
  103. scopeId,
  104. moduleIdentifier, /* server only */
  105. shadowMode /* vue-cli only */
  106. ) {
  107. // Vue.extend constructor export interop
  108. var options = typeof scriptExports === 'function'
  109. ? scriptExports.options
  110. : scriptExports
  111. // render functions
  112. if (render) {
  113. options.render = render
  114. options.staticRenderFns = staticRenderFns
  115. options._compiled = true
  116. }
  117. // functional template
  118. if (functionalTemplate) {
  119. options.functional = true
  120. }
  121. // scopedId
  122. if (scopeId) {
  123. options._scopeId = 'data-v-' + scopeId
  124. }
  125. var hook
  126. if (moduleIdentifier) { // server build
  127. hook = function (context) {
  128. // 2.3 injection
  129. context =
  130. context || // cached call
  131. (this.$vnode && this.$vnode.ssrContext) || // stateful
  132. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  133. // 2.2 with runInNewContext: true
  134. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  135. context = __VUE_SSR_CONTEXT__
  136. }
  137. // inject component styles
  138. if (injectStyles) {
  139. injectStyles.call(this, context)
  140. }
  141. // register component module identifier for async chunk inferrence
  142. if (context && context._registeredComponents) {
  143. context._registeredComponents.add(moduleIdentifier)
  144. }
  145. }
  146. // used by ssr in case component is cached and beforeCreate
  147. // never gets called
  148. options._ssrRegister = hook
  149. } else if (injectStyles) {
  150. hook = shadowMode
  151. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  152. : injectStyles
  153. }
  154. if (hook) {
  155. if (options.functional) {
  156. // for template-only hot-reload because in that case the render fn doesn't
  157. // go through the normalizer
  158. options._injectStyles = hook
  159. // register for functioal component in vue file
  160. var originalRender = options.render
  161. options.render = function renderWithStyleInjection (h, context) {
  162. hook.call(context)
  163. return originalRender(h, context)
  164. }
  165. } else {
  166. // inject component registration as beforeCreate hook
  167. var existing = options.beforeCreate
  168. options.beforeCreate = existing
  169. ? [].concat(existing, hook)
  170. : [hook]
  171. }
  172. }
  173. return {
  174. exports: scriptExports,
  175. options: options
  176. }
  177. }
  178. /***/ }),
  179. /***/ 129:
  180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  181. "use strict";
  182. __webpack_require__.r(__webpack_exports__);
  183. // EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition"
  184. var collapse_transition_ = __webpack_require__(28);
  185. var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_);
  186. // EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js
  187. var menu_mixin = __webpack_require__(37);
  188. // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
  189. var emitter_ = __webpack_require__(4);
  190. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  191. // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
  192. var vue_popper_ = __webpack_require__(5);
  193. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  194. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=script&lang=js&
  195. var poperMixins = {
  196. props: {
  197. transformOrigin: {
  198. type: [Boolean, String],
  199. default: false
  200. },
  201. offset: vue_popper_default.a.props.offset,
  202. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  203. popperOptions: vue_popper_default.a.props.popperOptions
  204. },
  205. data: vue_popper_default.a.data,
  206. methods: vue_popper_default.a.methods,
  207. beforeDestroy: vue_popper_default.a.beforeDestroy,
  208. deactivated: vue_popper_default.a.deactivated
  209. };
  210. /* harmony default export */ var submenuvue_type_script_lang_js_ = ({
  211. name: 'ElSubmenu',
  212. componentName: 'ElSubmenu',
  213. mixins: [menu_mixin["a" /* default */], emitter_default.a, poperMixins],
  214. components: { ElCollapseTransition: collapse_transition_default.a },
  215. props: {
  216. index: {
  217. type: String,
  218. required: true
  219. },
  220. showTimeout: {
  221. type: Number,
  222. default: 300
  223. },
  224. hideTimeout: {
  225. type: Number,
  226. default: 300
  227. },
  228. popperClass: String,
  229. disabled: Boolean,
  230. popperAppendToBody: {
  231. type: Boolean,
  232. default: undefined
  233. }
  234. },
  235. data: function data() {
  236. return {
  237. popperJS: null,
  238. timeout: null,
  239. items: {},
  240. submenus: {},
  241. mouseInChild: false
  242. };
  243. },
  244. watch: {
  245. opened: function opened(val) {
  246. var _this = this;
  247. if (this.isMenuPopup) {
  248. this.$nextTick(function (_) {
  249. _this.updatePopper();
  250. });
  251. }
  252. }
  253. },
  254. computed: {
  255. // popper option
  256. appendToBody: function appendToBody() {
  257. return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
  258. },
  259. menuTransitionName: function menuTransitionName() {
  260. return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
  261. },
  262. opened: function opened() {
  263. return this.rootMenu.openedMenus.indexOf(this.index) > -1;
  264. },
  265. active: function active() {
  266. var isActive = false;
  267. var submenus = this.submenus;
  268. var items = this.items;
  269. Object.keys(items).forEach(function (index) {
  270. if (items[index].active) {
  271. isActive = true;
  272. }
  273. });
  274. Object.keys(submenus).forEach(function (index) {
  275. if (submenus[index].active) {
  276. isActive = true;
  277. }
  278. });
  279. return isActive;
  280. },
  281. hoverBackground: function hoverBackground() {
  282. return this.rootMenu.hoverBackground;
  283. },
  284. backgroundColor: function backgroundColor() {
  285. return this.rootMenu.backgroundColor || '';
  286. },
  287. activeTextColor: function activeTextColor() {
  288. return this.rootMenu.activeTextColor || '';
  289. },
  290. textColor: function textColor() {
  291. return this.rootMenu.textColor || '';
  292. },
  293. mode: function mode() {
  294. return this.rootMenu.mode;
  295. },
  296. isMenuPopup: function isMenuPopup() {
  297. return this.rootMenu.isMenuPopup;
  298. },
  299. titleStyle: function titleStyle() {
  300. if (this.mode !== 'horizontal') {
  301. return {
  302. color: this.textColor
  303. };
  304. }
  305. return {
  306. borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
  307. color: this.active ? this.activeTextColor : this.textColor
  308. };
  309. },
  310. isFirstLevel: function isFirstLevel() {
  311. var isFirstLevel = true;
  312. var parent = this.$parent;
  313. while (parent && parent !== this.rootMenu) {
  314. if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
  315. isFirstLevel = false;
  316. break;
  317. } else {
  318. parent = parent.$parent;
  319. }
  320. }
  321. return isFirstLevel;
  322. }
  323. },
  324. methods: {
  325. handleCollapseToggle: function handleCollapseToggle(value) {
  326. if (value) {
  327. this.initPopper();
  328. } else {
  329. this.doDestroy();
  330. }
  331. },
  332. addItem: function addItem(item) {
  333. this.$set(this.items, item.index, item);
  334. },
  335. removeItem: function removeItem(item) {
  336. delete this.items[item.index];
  337. },
  338. addSubmenu: function addSubmenu(item) {
  339. this.$set(this.submenus, item.index, item);
  340. },
  341. removeSubmenu: function removeSubmenu(item) {
  342. delete this.submenus[item.index];
  343. },
  344. handleClick: function handleClick() {
  345. var rootMenu = this.rootMenu,
  346. disabled = this.disabled;
  347. if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  348. return;
  349. }
  350. this.dispatch('ElMenu', 'submenu-click', this);
  351. },
  352. handleMouseenter: function handleMouseenter(event) {
  353. var _this2 = this;
  354. var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout;
  355. if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
  356. return;
  357. }
  358. var rootMenu = this.rootMenu,
  359. disabled = this.disabled;
  360. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  361. return;
  362. }
  363. this.dispatch('ElSubmenu', 'mouse-enter-child');
  364. clearTimeout(this.timeout);
  365. this.timeout = setTimeout(function () {
  366. _this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
  367. }, showTimeout);
  368. if (this.appendToBody) {
  369. this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter'));
  370. }
  371. },
  372. handleMouseleave: function handleMouseleave() {
  373. var _this3 = this;
  374. var deepDispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  375. var rootMenu = this.rootMenu;
  376. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
  377. return;
  378. }
  379. this.dispatch('ElSubmenu', 'mouse-leave-child');
  380. clearTimeout(this.timeout);
  381. this.timeout = setTimeout(function () {
  382. !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
  383. }, this.hideTimeout);
  384. if (this.appendToBody && deepDispatch) {
  385. if (this.$parent.$options.name === 'ElSubmenu') {
  386. this.$parent.handleMouseleave(true);
  387. }
  388. }
  389. },
  390. handleTitleMouseenter: function handleTitleMouseenter() {
  391. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  392. var title = this.$refs['submenu-title'];
  393. title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
  394. },
  395. handleTitleMouseleave: function handleTitleMouseleave() {
  396. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  397. var title = this.$refs['submenu-title'];
  398. title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
  399. },
  400. updatePlacement: function updatePlacement() {
  401. this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
  402. },
  403. initPopper: function initPopper() {
  404. this.referenceElm = this.$el;
  405. this.popperElm = this.$refs.menu;
  406. this.updatePlacement();
  407. }
  408. },
  409. created: function created() {
  410. var _this4 = this;
  411. this.$on('toggle-collapse', this.handleCollapseToggle);
  412. this.$on('mouse-enter-child', function () {
  413. _this4.mouseInChild = true;
  414. clearTimeout(_this4.timeout);
  415. });
  416. this.$on('mouse-leave-child', function () {
  417. _this4.mouseInChild = false;
  418. clearTimeout(_this4.timeout);
  419. });
  420. },
  421. mounted: function mounted() {
  422. this.parentMenu.addSubmenu(this);
  423. this.rootMenu.addSubmenu(this);
  424. this.initPopper();
  425. },
  426. beforeDestroy: function beforeDestroy() {
  427. this.parentMenu.removeSubmenu(this);
  428. this.rootMenu.removeSubmenu(this);
  429. },
  430. render: function render(h) {
  431. var _this5 = this;
  432. var active = this.active,
  433. opened = this.opened,
  434. paddingStyle = this.paddingStyle,
  435. titleStyle = this.titleStyle,
  436. backgroundColor = this.backgroundColor,
  437. rootMenu = this.rootMenu,
  438. currentPlacement = this.currentPlacement,
  439. menuTransitionName = this.menuTransitionName,
  440. mode = this.mode,
  441. disabled = this.disabled,
  442. popperClass = this.popperClass,
  443. $slots = this.$slots,
  444. isFirstLevel = this.isFirstLevel;
  445. var popupMenu = h(
  446. 'transition',
  447. {
  448. attrs: { name: menuTransitionName }
  449. },
  450. [h(
  451. 'div',
  452. {
  453. ref: 'menu',
  454. directives: [{
  455. name: 'show',
  456. value: opened
  457. }],
  458. 'class': ['el-menu--' + mode, popperClass],
  459. on: {
  460. 'mouseenter': function mouseenter($event) {
  461. return _this5.handleMouseenter($event, 100);
  462. },
  463. 'mouseleave': function mouseleave() {
  464. return _this5.handleMouseleave(true);
  465. },
  466. 'focus': function focus($event) {
  467. return _this5.handleMouseenter($event, 100);
  468. }
  469. }
  470. },
  471. [h(
  472. 'ul',
  473. {
  474. attrs: {
  475. role: 'menu'
  476. },
  477. 'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement],
  478. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  479. [$slots.default]
  480. )]
  481. )]
  482. );
  483. var inlineMenu = h('el-collapse-transition', [h(
  484. 'ul',
  485. {
  486. attrs: {
  487. role: 'menu'
  488. },
  489. 'class': 'el-menu el-menu--inline',
  490. directives: [{
  491. name: 'show',
  492. value: opened
  493. }],
  494. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  495. [$slots.default]
  496. )]);
  497. var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
  498. return h(
  499. 'li',
  500. {
  501. 'class': {
  502. 'el-submenu': true,
  503. 'is-active': active,
  504. 'is-opened': opened,
  505. 'is-disabled': disabled
  506. },
  507. attrs: { role: 'menuitem',
  508. 'aria-haspopup': 'true',
  509. 'aria-expanded': opened
  510. },
  511. on: {
  512. 'mouseenter': this.handleMouseenter,
  513. 'mouseleave': function mouseleave() {
  514. return _this5.handleMouseleave(false);
  515. },
  516. 'focus': this.handleMouseenter
  517. }
  518. },
  519. [h(
  520. 'div',
  521. {
  522. 'class': 'el-submenu__title',
  523. ref: 'submenu-title',
  524. on: {
  525. 'click': this.handleClick,
  526. 'mouseenter': this.handleTitleMouseenter,
  527. 'mouseleave': this.handleTitleMouseleave
  528. },
  529. style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }]
  530. },
  531. [$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })]
  532. ), this.isMenuPopup ? popupMenu : inlineMenu]
  533. );
  534. }
  535. });
  536. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js&
  537. /* harmony default export */ var src_submenuvue_type_script_lang_js_ = (submenuvue_type_script_lang_js_);
  538. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  539. var componentNormalizer = __webpack_require__(0);
  540. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue
  541. var render, staticRenderFns
  542. /* normalize component */
  543. var component = Object(componentNormalizer["a" /* default */])(
  544. src_submenuvue_type_script_lang_js_,
  545. render,
  546. staticRenderFns,
  547. false,
  548. null,
  549. null,
  550. null
  551. )
  552. /* hot reload */
  553. if (false) { var api; }
  554. component.options.__file = "packages/menu/src/submenu.vue"
  555. /* harmony default export */ var submenu = (component.exports);
  556. // CONCATENATED MODULE: ./packages/submenu/index.js
  557. /* istanbul ignore next */
  558. submenu.install = function (Vue) {
  559. Vue.component(submenu.name, submenu);
  560. };
  561. /* harmony default export */ var packages_submenu = __webpack_exports__["default"] = (submenu);
  562. /***/ }),
  563. /***/ 28:
  564. /***/ (function(module, exports) {
  565. module.exports = require("element-ui/lib/transitions/collapse-transition");
  566. /***/ }),
  567. /***/ 37:
  568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  569. "use strict";
  570. /* harmony default export */ __webpack_exports__["a"] = ({
  571. inject: ['rootMenu'],
  572. computed: {
  573. indexPath: function indexPath() {
  574. var path = [this.index];
  575. var parent = this.$parent;
  576. while (parent.$options.componentName !== 'ElMenu') {
  577. if (parent.index) {
  578. path.unshift(parent.index);
  579. }
  580. parent = parent.$parent;
  581. }
  582. return path;
  583. },
  584. parentMenu: function parentMenu() {
  585. var parent = this.$parent;
  586. while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
  587. parent = parent.$parent;
  588. }
  589. return parent;
  590. },
  591. paddingStyle: function paddingStyle() {
  592. if (this.rootMenu.mode !== 'vertical') return {};
  593. var padding = 20;
  594. var parent = this.$parent;
  595. if (this.rootMenu.collapse) {
  596. padding = 20;
  597. } else {
  598. while (parent && parent.$options.componentName !== 'ElMenu') {
  599. if (parent.$options.componentName === 'ElSubmenu') {
  600. padding += 20;
  601. }
  602. parent = parent.$parent;
  603. }
  604. }
  605. return { paddingLeft: padding + 'px' };
  606. }
  607. }
  608. });
  609. /***/ }),
  610. /***/ 4:
  611. /***/ (function(module, exports) {
  612. module.exports = require("element-ui/lib/mixins/emitter");
  613. /***/ }),
  614. /***/ 5:
  615. /***/ (function(module, exports) {
  616. module.exports = require("element-ui/lib/utils/vue-popper");
  617. /***/ })
  618. /******/ });