Files
zhibo/node_modules/ele-admin/es/ele-pro-layout/components/pro-sidebar.js
T
xiaoyu 5488f5f0a2 init
2023-05-22 14:07:59 +08:00

104 lines
3.3 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: "ProSidebar",
components: { ProMenus },
props: {
data: Array,
active: String,
collapse: Boolean,
uniqueOpen: Boolean,
defaultOpeneds: Array,
themeClass: String
},
emits: ["open", "close"],
methods: {
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" }, [_vm._t("top"), _c("div", { staticClass: "ele-admin-sidebar-menus" }, [_c("el-scrollbar", { ref: "scrollbar" }, [_c("ProMenus", { attrs: { "data": _vm.data, "active": _vm.active, "collapse": _vm.collapse, "unique-open": _vm.uniqueOpen, "default-openeds": _vm.defaultOpeneds, "theme-class": _vm.themeClass, "pop-class": _vm.themeClass }, 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._t("bottom")], 2);
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns,
false,
null,
null,
null,
null
);
const proSidebar = __component__.exports;
export {
proSidebar as default
};