UNPKG

@opensig/opendesign

Version:

<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>

63 lines (62 loc) 2.13 kB
import { defineComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, createElementVNode, renderSlot } from "vue"; import { defaultSize } from "../../_utils/global.mjs"; import { inBoxProps } from "./types.mjs"; import { getRoundClass } from "../../_utils/style-class.mjs"; const _hoisted_1 = { key: 0, class: "o_box-prepend" }; const _hoisted_2 = { key: 1, class: "o_box-append" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "InBox", props: inBoxProps, setup(__props) { const props = __props; const round = getRoundClass(props, "_box"); return (_ctx, _cache) => { var _a, _b, _c, _d; return openBlock(), createElementBlock( "div", { class: normalizeClass(["o_box", [`o_box-${props.color}`, `o_box-${props.variant}`, `o_box-${props.size || unref(defaultSize)}`, unref(round).class.value]]), style: normalizeStyle(unref(round).style.value) }, [ ((_b = (_a = _ctx.$slots).prepend) == null ? void 0 : _b.call(_a)) ? (openBlock(), createElementBlock("div", _hoisted_1, [ renderSlot(_ctx.$slots, "prepend") ])) : createCommentVNode("v-if", true), createElementVNode( "div", { class: normalizeClass(["o_box-main", [ { "o_box-disabled": props.disabled, "o_box-readonly": props.readonly, "o_box-focused": props.focused, "has-prepend": _ctx.$slots.prepend, "has-append": _ctx.$slots.append } ]]) }, [ renderSlot(_ctx.$slots, "default") ], 2 /* CLASS */ ), ((_d = (_c = _ctx.$slots).append) == null ? void 0 : _d.call(_c)) ? (openBlock(), createElementBlock("div", _hoisted_2, [ renderSlot(_ctx.$slots, "append") ])) : createCommentVNode("v-if", true) ], 6 /* CLASS, STYLE */ ); }; } }); export { _sfc_main as default };