@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>
99 lines (98 loc) • 3.4 kB
JavaScript
;
const vue = require("vue");
const types = require("./types.js");
const icons = require("../_utils/icons.js");
const _hoisted_1 = {
key: 0,
class: "o-result-image"
};
const _hoisted_2 = {
key: 1,
class: "o-result-header"
};
const _hoisted_3 = {
key: 1,
class: "o-result-title"
};
const _hoisted_4 = {
key: 2,
class: "o-result-description"
};
const _hoisted_5 = {
key: 3,
class: "o-result-extra"
};
const _hoisted_6 = {
key: 4,
class: "o-result-content"
};
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "OResult",
props: types.resultProps,
setup(__props) {
const props = __props;
const iconMap = {
info: icons.IconInfo.value,
success: icons.IconSuccess.value,
warning: icons.IconWarning.value,
danger: icons.IconDanger.value
};
const icon = vue.computed(() => props.status ? iconMap[props.status] : void 0);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-result", { [`o-result-${props.status}`]: props.status }])
},
[
_ctx.$slots.image ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
vue.renderSlot(_ctx.$slots, "image")
])) : vue.createCommentVNode("v-if", true),
props.status || _ctx.$slots.icon || props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
props.status || _ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-result-icon", { "o-result-icon-custom": _ctx.$slots.icon }])
},
[
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(icon.value)))
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
vue.renderSlot(_ctx.$slots, "title", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.title),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true),
props.description || _ctx.$slots.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
vue.renderSlot(_ctx.$slots, "description", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.description),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true),
_ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
vue.renderSlot(_ctx.$slots, "extra")
])) : vue.createCommentVNode("v-if", true),
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
vue.renderSlot(_ctx.$slots, "default")
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
module.exports = _sfc_main;