yuang-framework-ui-pc
Version:
yuang-framework-ui-pc Library
66 lines (65 loc) • 2.82 kB
JavaScript
"use strict";
const vue = require("vue");
const elementPlus = require("element-plus");
const ReceiverView = require("../ele-config-provider/components/receiver-view");
const props = require("./props");
const _sfc_main = vue.defineComponent({
name: "EleLoading",
directives: { loading: elementPlus.vLoading },
components: { ReceiverView },
props: props.loadingProps,
setup(props2) {
const isCircle = vue.computed(() => {
return props2.type === "circle";
});
return { isCircle };
}
});
const _export_sfc = (sfc, props2) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props2) {
target[key] = val;
}
return target;
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_ReceiverView = vue.resolveComponent("ReceiverView");
const _directive_loading = vue.resolveDirective("loading");
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_ReceiverView, {
"element-loading-text": _ctx.isCircle ? _ctx.text : void 0,
"element-loading-background": _ctx.isCircle ? _ctx.background : void 0,
"element-loading-spinner": _ctx.isCircle ? _ctx.spinner : void 0,
"element-loading-svg-view-box": _ctx.isCircle ? _ctx.svgViewBox : void 0,
class: vue.normalizeClass(["ele-loading", { "ele-loading-show": _ctx.loading }])
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default"),
!_ctx.isCircle ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
key: 0,
style: vue.normalizeStyle(_ctx.spinnerStyle),
class: vue.normalizeClass(["ele-loading-spinner", { "ele-loading-blur": _ctx.blur }, { "ele-loading-small": _ctx.size === "small" }, { "ele-loading-large": _ctx.size === "large" }])
}, [
vue.renderSlot(_ctx.$slots, "spinner", {}, () => [
_cache[0] || (_cache[0] = vue.createElementVNode("div", { class: "ele-loading-dot" }, [
vue.createElementVNode("i"),
vue.createElementVNode("i"),
vue.createElementVNode("i"),
vue.createElementVNode("i")
], -1))
]),
_ctx.text ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: "ele-loading-text",
style: vue.normalizeStyle(_ctx.textStyle)
}, vue.toDisplayString(_ctx.text), 5)) : vue.createCommentVNode("", true)
], 6)), [
[vue.vShow, _ctx.loading]
]) : vue.createCommentVNode("", true)
]),
_: 3
}, 8, ["element-loading-text", "element-loading-background", "element-loading-spinner", "element-loading-svg-view-box", "class"])), [
[_directive_loading, _ctx.isCircle && _ctx.loading]
]);
}
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
module.exports = index;