yk-element-components-v2
Version:
92 lines (91 loc) • 2.84 kB
JavaScript
function m(t, e, l, f, a, n, r, u) {
var s = typeof t == "function" ? t.options : t;
e && (s.render = e, s.staticRenderFns = l, s._compiled = !0), f && (s.functional = !0), n && (s._scopeId = "data-v-" + n);
var o;
if (r ? (o = function(i) {
i = i || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !i && typeof __VUE_SSR_CONTEXT__ < "u" && (i = __VUE_SSR_CONTEXT__), a && a.call(this, i), i && i._registeredComponents && i._registeredComponents.add(r);
}, s._ssrRegister = o) : a && (o = u ? function() {
a.call(
this,
(s.functional ? this.parent : this).$root.$options.shadowRoot
);
} : a), o)
if (s.functional) {
s._injectStyles = o;
var p = s.render;
s.render = function(h, c) {
return o.call(c), p(h, c);
};
} else {
var d = s.beforeCreate;
s.beforeCreate = d ? [].concat(d, o) : [o];
}
return {
exports: t,
options: s
};
}
const C = {
name: "yk-aside",
props: {
width: {
type: String,
default: "232px"
},
background: {
type: String,
default: "#FFFFFF"
},
icon: {
type: String,
default: ""
},
color: {
type: String,
default: "#000000"
},
borderColor: {
type: String,
default: "#EEEEEE"
},
animation: Boolean
},
data() {
return {
isCollapse: !1,
isScroll: !1,
timer: null
};
},
methods: {
fold() {
this.isCollapse = !this.isCollapse, this.isCollapse ? this.$emit("close") : this.$emit("open");
},
asideScroll() {
this.isScroll = !0, clearTimeout(this.timer), this.timer = null, this.timer = setTimeout(() => {
this.isScroll = !1;
}, 800);
}
}
};
var v = function() {
var e = this, l = e._self._c;
return l("aside", { staticClass: "yk-aside", style: { width: e.isCollapse ? "64px" : e.width, minWidth: e.isCollapse ? "64px" : e.width, background: e.background, borderColor: e.borderColor } }, [e.animation ? l("transition", { staticClass: "yk-aside-box", attrs: { name: "yk-drawer-left" } }, [l("div", { directives: [{ name: "show", rawName: "v-show", value: !e.isCollapse, expression: "!isCollapse" }], staticClass: "yk-aside-box", class: { hideScroll: !e.isScroll }, on: { scroll: e.asideScroll } }, [e._t("default")], 2)]) : l("div", { staticClass: "yk-aside-box", class: { hideScroll: !e.isScroll }, on: { scroll: e.asideScroll } }, [e._t("default")], 2), e.icon ? l("i", { staticClass: "aside-icon", class: e.icon, style: { color: e.color }, on: { click: e.fold } }) : e._e()], 1);
}, S = [], y = /* @__PURE__ */ m(
C,
v,
S,
!1,
null,
"376d00a9",
null,
null
);
const _ = y.exports, b = {
install(t) {
t.component(_.name, _);
}
};
export {
b as default
};