yuang-framework-ui-pc
Version:
yuang-framework-ui-pc Library
62 lines (61 loc) • 2.07 kB
JavaScript
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
import { dashboardProps } from "./props";
const _sfc_main = defineComponent({
name: "EleDashboard",
props: dashboardProps,
setup(props) {
const rootStyle = computed(() => {
const style = {};
if (props.size != null) {
if (typeof props.size === "number") {
style.width = `${props.size}px`;
style.height = `${props.size}px`;
} else {
style.width = props.size;
style.height = props.size;
}
}
if (props.space != null) {
style["--ele-dashboard-space"] = typeof props.space === "number" ? `${props.space}px` : props.space;
}
if (props.color) {
style["--ele-dashboard-color"] = props.color;
}
return style;
});
return { rootStyle };
}
});
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _hoisted_1 = { class: "ele-dashboard-inner" };
const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "ele-dashboard-outer" }, [
/* @__PURE__ */ createElementVNode("div", { class: "ele-dashboard-bg" }),
/* @__PURE__ */ createElementVNode("div", { class: "ele-dashboard-bg" }),
/* @__PURE__ */ createElementVNode("div", { class: "ele-dashboard-bg" })
], -1);
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", {
class: normalizeClass([
"ele-dashboard",
{ "is-success": _ctx.type === "success" },
{ "is-warning": _ctx.type === "warning" },
{ "is-danger": _ctx.type === "danger" }
]),
style: normalizeStyle(_ctx.rootStyle)
}, [
createElementVNode("div", _hoisted_1, [
renderSlot(_ctx.$slots, "default")
]),
_hoisted_2
], 6);
}
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
index as default
};