UNPKG

tass-ui

Version:

A high quality UI Toolkit built on Vue.js3+.

98 lines (97 loc) 3.6 kB
import { defineComponent, getCurrentInstance, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeStyle, renderSlot, toDisplayString, createVNode, createTextVNode, vShow } from "vue"; import "../../../theme-chalk/src/dialog.scss.mjs"; const _hoisted_1 = { class: "tas-dialog" }; const _hoisted_2 = { class: "tas-dialog__body" }; const _hoisted_3 = { class: "tas-dialog__header" }; const _hoisted_4 = { class: "tas-dialog__title" }; const _hoisted_5 = { class: "tas-dialog__box" }; const _hoisted_6 = { class: "tas-dialog__footer" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "dialog", props: { title: { required: false, default: "dialog", type: String }, visible: { required: false, default: false, type: Boolean }, width: { required: false, default: "auto", type: String } }, setup(__props) { const currentInstance = getCurrentInstance(); function onClickCancelButton(e) { currentInstance == null ? void 0 : currentInstance.emit("cancel", e); } function onClickConfirmButton(e) { currentInstance == null ? void 0 : currentInstance.emit("confirm", e); } return (_ctx, _cache) => { const _component_tass_icon = resolveComponent("tass-icon"); const _component_tass_button = resolveComponent("tass-button"); return openBlock(), createBlock(Transition, { name: "tas-dialog-fade" }, { default: withCtx(() => [ withDirectives(createElementVNode("div", _hoisted_1, [ withDirectives(createElementVNode("div", _hoisted_2, [ createElementVNode("div", { class: "tas-dialog__box", style: normalizeStyle(`width:${__props.width}`) }, [ createElementVNode("div", null, [ renderSlot(_ctx.$slots, "headerContent"), createElementVNode("div", _hoisted_3, [ createElementVNode("h3", _hoisted_4, toDisplayString(__props.title), 1), createElementVNode("span", { class: "tas-dialog__close", onClick: onClickCancelButton }, [ createVNode(_component_tass_icon, { name: "cross" }) ]) ]) ]), createElementVNode("div", _hoisted_5, [ renderSlot(_ctx.$slots, "default") ]), createElementVNode("div", null, [ renderSlot(_ctx.$slots, "footerContent"), createElementVNode("div", _hoisted_6, [ createVNode(_component_tass_button, { mode: "text", onClick: onClickCancelButton }, { default: withCtx(() => [ createTextVNode(" 取消 ") ]), _: 1 }), createVNode(_component_tass_button, { onClick: onClickConfirmButton }, { default: withCtx(() => [ createTextVNode(" 确定 ") ]), _: 1 }) ]) ]) ], 4) ], 512), [ [vShow, __props.visible] ]) ], 512), [ [vShow, __props.visible] ]) ]), _: 3 }); }; } }); export { _sfc_main as default };