UNPKG

various-ui

Version:

This is a test version of the Vue 3 component library

77 lines (72 loc) 2.46 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); var index$1 = require('../../icon/index.js'); var index = require('./index.js'); var composable = require('./src/composable.js'); const _hoisted_1 = ["type", "disabled"]; const _hoisted_2 = { key: 0, class: "ui-mask ui-loading" }; const __default__ = vue.defineComponent({ name: "UiButton" }); var _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: index.UiButtonPropsOption, emits: index.UiButtonEmits, setup(__props, { expose: __expose, emit: __emit }) { ; const define = __props; const emits = __emit; const { computeds, methods, status } = composable.useComposable(define, emits); const { className, style } = computeds; const { click } = methods; __expose({ click }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock( "div", { class: vue.normalizeClass(["ui-button", vue.unref(className)]) }, [ vue.createCommentVNode(" \u6309\u94AE\u4E3B\u4F53 "), vue.createElementVNode("button", { class: "ui-button-main", type: _ctx.nativeType, style: vue.normalizeStyle(vue.unref(style)), disabled: _ctx.disabled, onClick: _cache[0] || (_cache[0] = //@ts-ignore (...args) => vue.unref(click) && vue.unref(click)(...args)) }, [ vue.renderSlot(_ctx.$slots, "default") ], 12, _hoisted_1), vue.createCommentVNode(" \u906E\u7F69\u5C42 "), vue.createVNode(vue.Transition, null, { default: vue.withCtx(() => [ vue.unref(status).name == "loading" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [ vue.withDirectives(vue.createVNode( vue.unref(index$1.UiIcon), { name: "loading", class: "ui-mask-icon" }, null, 512 /* NEED_PATCH */ ), [ [vue.vShow, vue.unref(status).is] ]) ])) : vue.createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }) ], 2 /* CLASS */ ); }; } }); exports.default = _sfc_main; //# sourceMappingURL=index.vue2.js.map