winbox-ui-next
Version:
We Design Vue 2.0: A Vue.js 3 UI Library
52 lines (51 loc) • 1.76 kB
JavaScript
import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createBlock, createTextVNode, toDisplayString } from "vue";
import { getPrefixCls } from "../_utils/global-config.js";
import IconEmpty from "../icon/icon-empty/index.js";
import { useI18n } from "../locale/index.js";
import _export_sfc from "../_virtual/plugin-vue_export-helper";
const _sfc_main = defineComponent({
name: "Empty",
components: {
IconEmpty
},
props: {
description: String,
image: String
},
setup() {
const prefixCls = getPrefixCls("empty");
const { t } = useI18n();
return {
prefixCls,
t
};
}
});
const _hoisted_1 = ["src", "alt"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_icon_empty = resolveComponent("icon-empty");
return openBlock(), createElementBlock("div", {
class: normalizeClass(_ctx.prefixCls)
}, [
createElementVNode("div", {
class: normalizeClass(`${_ctx.prefixCls}-image`)
}, [
renderSlot(_ctx.$slots, "image", {}, () => [
_ctx.image ? (openBlock(), createElementBlock("img", {
key: 0,
src: _ctx.image,
alt: _ctx.description || "empty"
}, null, 8, _hoisted_1)) : (openBlock(), createBlock(_component_icon_empty, { key: 1 }))
])
], 2),
createElementVNode("div", {
class: normalizeClass(`${_ctx.prefixCls}-description`)
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString(_ctx.description || _ctx.t("empty.description")), 1)
])
], 2)
], 2);
}
var _Empty = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export { _Empty as default };