UNPKG

@ued_fpi/data-visual

Version:

<br /> <br /> <div style="text-align:center"> <b style="font-size:30px">@ued_fpi/data-visual</b> <p>基于Vite4+TypeScript的Vue3大屏组件库开发框架</p> <img style="display:inline" src="https://img.shields.io/npm/v/@ued_fpi/data-visual" />

69 lines (66 loc) 2.21 kB
import { ElScrollbar } from 'element-plus/es'; import 'element-plus/es/components/base/style/css'; import 'element-plus/es/components/scrollbar/style/css'; import { defineComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, createVNode, withCtx, createElementVNode, renderSlot } from 'vue'; const clsfix = "dv-aims-basic-panel"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", props: { // 设置高度 height: { type: [Number, String], default: "calc(100vh - 130px)" }, // 设置方位 left right placement: { type: String, required: true }, // 设置距离顶部的 top top: { type: [Number, String], default: 120 }, // 滚动包裹容器的样式 scrollContainerClass: { type: String, default: "" }, // 滚动包裹容器的样式 scrollContainerStyle: { type: Object, default: () => ({}) } }, setup(__props) { return (_ctx, _cache) => { const _component_el_scrollbar = ElScrollbar; return openBlock(), createElementBlock("div", { style: normalizeStyle({ top: typeof __props.top === "number" ? `${__props.top}px` : __props.top, height: typeof __props.height === "number" ? `${__props.height}px` : __props.height, left: __props.placement === "left" ? 0 : "unset", right: __props.placement === "right" ? 0 : "unset" }), class: normalizeClass(`${clsfix}-container`) }, [ createVNode(_component_el_scrollbar, { height: "100%" }, { default: withCtx(() => [ createElementVNode("div", { class: normalizeClass([`${clsfix}-scroll-container`, __props.scrollContainerClass]), style: normalizeStyle({ paddingLeft: __props.placement === "left" ? "16px" : "10px", paddingRight: __props.placement === "right" ? "16px" : "10px", ...__props.scrollContainerStyle }) }, [ renderSlot(_ctx.$slots, "default") ], 6) ]), _: 3 }) ], 6); }; } }); export { _sfc_main as default };