@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>
68 lines (67 loc) • 2.05 kB
JavaScript
import { defineComponent, createElementBlock, openBlock, normalizeClass, unref, createVNode, createCommentVNode, withCtx, renderSlot } from "vue";
import { defaultSize } from "../_utils/global.mjs";
import { IconLoading } from "../_utils/icons.mjs";
import "../option/index.mjs";
import slot from "./slot.mjs";
import _sfc_main$1 from "../option/OOptionList.vue.mjs";
const _hoisted_1 = {
key: 0,
class: "o-select-options-loading"
};
const _hoisted_2 = {
key: 0,
class: "o-select-actions"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "SelectOption",
props: {
size: {},
wrapClass: {},
loading: { type: Boolean },
optionTitle: {},
multiple: { type: Boolean }
},
setup(__props) {
const props = __props;
const scrollbarCfg = {
barClass: "o-select-options-scrollbar",
size: "small",
showType: "hover"
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass(["o-select-options", [
`o-select-options-${props.size || unref(defaultSize)}`,
{
"o-select-options-multiple": props.multiple
}
]])
},
[
createVNode(unref(_sfc_main$1), {
"wrap-class": props.wrapClass,
scrollbar: scrollbarCfg
}, {
default: withCtx(() => [
props.loading ? (openBlock(), createElementBlock("div", _hoisted_1, [
createVNode(unref(IconLoading), { class: "o-rotating" })
])) : renderSlot(_ctx.$slots, unref(slot).names.optionTarget, { key: 1 })
]),
_: 3
/* FORWARDED */
}, 8, ["wrap-class"]),
_ctx.$slots.action ? (openBlock(), createElementBlock("div", _hoisted_2, [
renderSlot(_ctx.$slots, unref(slot).option.names.action)
])) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
export {
_sfc_main as default
};