UNPKG

@fmdevui/fm-dev

Version:

Page level components developed based on Element Plus.

115 lines (110 loc) 3.93 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); var index = require('../../utils/other/index.js'); const _hoisted_1 = ["onClick"]; var _sfc_main = /* @__PURE__ */ vue.defineComponent({ __name: "subItem", props: { // 菜单列表 chil: { type: Array, default: () => [] } }, setup(__props) { const props = __props; const chils = vue.computed(() => { return props.chil; }); const onALinkClick = (val) => { index.default.handleOpenLink(val); }; return (_ctx, _cache) => { const _component_SvgIcon = vue.resolveComponent("SvgIcon"); const _component_sub_item = vue.resolveComponent("sub-item", true); const _component_el_sub_menu = vue.resolveComponent("el-sub-menu"); const _component_el_menu_item = vue.resolveComponent("el-menu-item"); return vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList(chils.value, (val) => { return vue.openBlock(), vue.createElementBlock( vue.Fragment, null, [ val.children && val.children.length > 0 ? (vue.openBlock(), vue.createBlock(_component_el_sub_menu, { index: val.path, key: val.path }, { title: vue.withCtx(() => [ vue.createVNode(_component_SvgIcon, { name: val.meta.icon }, null, 8, ["name"]), vue.createElementVNode( "span", null, vue.toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)), 1 /* TEXT */ ) ]), default: vue.withCtx(() => [ vue.createVNode(_component_sub_item, { chil: val.children }, null, 8, ["chil"]) ]), _: 2 /* DYNAMIC */ }, 1032, ["index"])) : (vue.openBlock(), vue.createBlock(_component_el_menu_item, { index: val.path, key: val.path }, { default: vue.withCtx(() => [ !val.meta.isLink || val.meta.isLink && val.meta.isIframe ? (vue.openBlock(), vue.createElementBlock( vue.Fragment, { key: 0 }, [ vue.createVNode(_component_SvgIcon, { name: val.meta.icon }, null, 8, ["name"]), vue.createElementVNode( "span", null, vue.toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)), 1 /* TEXT */ ) ], 64 /* STABLE_FRAGMENT */ )) : (vue.openBlock(), vue.createElementBlock("a", { key: 1, class: "w100", onClick: vue.withModifiers(($event) => onALinkClick(val), ["prevent"]) }, [ vue.createVNode(_component_SvgIcon, { name: val.meta.icon }, null, 8, ["name"]), vue.createTextVNode( " " + vue.toDisplayString(_ctx.$t(`message.menu.${val.meta.title}`)), 1 /* TEXT */ ) ], 8, _hoisted_1)) ]), _: 2 /* DYNAMIC */ }, 1032, ["index"])) ], 64 /* STABLE_FRAGMENT */ ); }), 256 /* UNKEYED_FRAGMENT */ ); }; } }); exports.default = _sfc_main;