112 lines
3.8 KiB
JavaScript
112 lines
3.8 KiB
JavaScript
import ProMenus from "./pro-menus";
|
|
function normalizeComponent(scriptExports, render2, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
if (render2) {
|
|
options.render = render2;
|
|
options.staticRenderFns = staticRenderFns;
|
|
options._compiled = true;
|
|
}
|
|
if (functionalTemplate) {
|
|
options.functional = true;
|
|
}
|
|
if (scopeId) {
|
|
options._scopeId = "data-v-" + scopeId;
|
|
}
|
|
var hook;
|
|
if (moduleIdentifier) {
|
|
hook = function(context) {
|
|
context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
context = __VUE_SSR_CONTEXT__;
|
|
}
|
|
if (injectStyles) {
|
|
injectStyles.call(this, context);
|
|
}
|
|
if (context && context._registeredComponents) {
|
|
context._registeredComponents.add(moduleIdentifier);
|
|
}
|
|
};
|
|
options._ssrRegister = hook;
|
|
} else if (injectStyles) {
|
|
hook = shadowMode ? function() {
|
|
injectStyles.call(
|
|
this,
|
|
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
);
|
|
} : injectStyles;
|
|
}
|
|
if (hook) {
|
|
if (options.functional) {
|
|
options._injectStyles = hook;
|
|
var originalRender = options.render;
|
|
options.render = function renderWithStyleInjection(h, context) {
|
|
hook.call(context);
|
|
return originalRender(h, context);
|
|
};
|
|
} else {
|
|
var existing = options.beforeCreate;
|
|
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
}
|
|
}
|
|
return {
|
|
exports: scriptExports,
|
|
options
|
|
};
|
|
}
|
|
const _sfc_main = {
|
|
name: "ProSidebarNav",
|
|
components: { ProMenus },
|
|
props: {
|
|
data: Array,
|
|
active: String,
|
|
collapse: Boolean,
|
|
themeClass: String,
|
|
showNavCollapse: Boolean
|
|
},
|
|
emits: ["toggle-collapse", "open", "close"],
|
|
computed: {
|
|
firstPopClass() {
|
|
const popClass = "ele-admin-sidebar-nav-menu-pop";
|
|
return this.themeClass ? this.themeClass + " " + popClass : popClass;
|
|
}
|
|
},
|
|
methods: {
|
|
toggleCollapse() {
|
|
this.$emit("toggle-collapse");
|
|
},
|
|
onOpen(index, indexPath) {
|
|
this.$emit("open", index, indexPath);
|
|
},
|
|
onClose(index, indexPath) {
|
|
this.$emit("close", index, indexPath);
|
|
},
|
|
updateScrollbar() {
|
|
var _a;
|
|
(_a = this.$refs.scrollbar) == null ? void 0 : _a.update();
|
|
}
|
|
}
|
|
};
|
|
var _sfc_render = function render() {
|
|
var _vm = this, _c = _vm._self._c;
|
|
return _c("div", { staticClass: "ele-admin-sidebar-nav" }, [_vm._t("nav-top"), _c("div", { staticClass: "ele-admin-sidebar-nav-menu" }, [_c("el-scrollbar", { ref: "scrollbar" }, [_c("ProMenus", { attrs: { "data": _vm.data, "active": _vm.active, "collapse": true, "unique-open": true, "pop-class": _vm.themeClass, "theme-class": _vm.themeClass, "first-pop-class": _vm.firstPopClass, "tooltip-disabled": !_vm.collapse, "title-slot": "nav-title" }, on: { "open": _vm.onOpen, "close": _vm.onClose }, scopedSlots: _vm._u([_vm._l(Object.keys(_vm.$scopedSlots), function(name) {
|
|
return { key: name, fn: function(props) {
|
|
return [_vm._t(name, null, null, props || {})];
|
|
} };
|
|
})], null, true) })], 1)], 1), _vm.showNavCollapse ? _c("div", { staticClass: "ele-admin-sidebar-nav-tool-item", on: { "click": _vm.toggleCollapse } }, [_c("i", { class: _vm.collapse ? "el-icon-_unfold" : "el-icon-_fold" })]) : _vm._e(), _vm._t("nav-bottom")], 2);
|
|
};
|
|
var _sfc_staticRenderFns = [];
|
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
_sfc_main,
|
|
_sfc_render,
|
|
_sfc_staticRenderFns,
|
|
false,
|
|
null,
|
|
null,
|
|
null,
|
|
null
|
|
);
|
|
const proSidebarNav = __component__.exports;
|
|
export {
|
|
proSidebarNav as default
|
|
};
|