yuang-framework-ui-pc
Version:
yuang-framework-ui-pc Library
63 lines (62 loc) • 2.57 kB
JavaScript
;
const vue = require("vue");
const icons = require("../../icons");
const _sfc_main = vue.defineComponent({
name: "MessageBoxIcon",
components: {
CloseOutlined: icons.CloseOutlined,
InfoCircleFilled: icons.InfoCircleFilled,
CheckCircleFilled: icons.CheckCircleFilled,
ExclamationCircleFilled: icons.ExclamationCircleFilled,
CloseCircleFilled: icons.CloseCircleFilled
},
props: {
/** 类型 */
type: String,
/** 图标 */
icon: [String, Object, Function],
/** 标识id */
boxId: String
},
emits: {
boxDestroy: (_boxId) => true,
boxMounted: (_) => true
},
setup(props, { emit }) {
var _a;
const ins = (_a = vue.getCurrentInstance) == null ? void 0 : _a.call(vue);
vue.onBeforeUnmount(() => {
emit("boxDestroy", props.boxId);
});
vue.onMounted(() => {
var _a2, _b;
emit("boxMounted", {
boxId: props.boxId,
// @ts-ignore
doClose: (_b = (_a2 = ins == null ? void 0 : ins.ctx) == null ? void 0 : _a2.$root) == null ? void 0 : _b.doClose
});
});
return {};
}
});
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _hoisted_1 = { class: "ele-message-box-icon" };
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_CheckCircleFilled = vue.resolveComponent("CheckCircleFilled");
const _component_ExclamationCircleFilled = vue.resolveComponent("ExclamationCircleFilled");
const _component_CloseCircleFilled = vue.resolveComponent("CloseCircleFilled");
const _component_InfoCircleFilled = vue.resolveComponent("InfoCircleFilled");
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon), { key: 0 })) : _ctx.type === "success" ? (vue.openBlock(), vue.createBlock(_component_CheckCircleFilled, { key: 1 })) : _ctx.type === "warning" ? (vue.openBlock(), vue.createBlock(_component_ExclamationCircleFilled, { key: 2 })) : _ctx.type === "error" ? (vue.openBlock(), vue.createBlock(_component_CloseCircleFilled, { key: 3 })) : _ctx.type === "info" ? (vue.openBlock(), vue.createBlock(_component_InfoCircleFilled, { key: 4 })) : vue.createCommentVNode("", true)
], 512)), [
[vue.vShow, _ctx.type || _ctx.icon]
]);
}
const messageBoxIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
module.exports = messageBoxIcon;