yanzhen-design-vue
Version:
51 lines (50 loc) • 1.83 kB
JavaScript
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const antDesignVue = require("ant-design-vue");
const useButton = require("./use-button.cjs");
const button = require("./button.cjs");
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...{ name: button.buttonName },
__name: "button",
props: button.buttonProps,
emits: button.buttonEmits,
setup(__props, { expose: __expose, emit: __emit }) {
var _a, _b;
const { ns } = button.buttonOptions;
const props = __props;
const emit = __emit;
const { _ref, _props, _disabled, handleClick, handleMousedown, _text } = useButton.useButton(props, emit);
__expose({
/** @description button html element */
ref: _ref,
/** @description button size */
size: _props.value.size,
/** @description button type */
type: _props.value.type,
/** @description button disabled */
disabled: _disabled,
blur: (_a = _ref.value) == null ? void 0 : _a.blur,
focus: (_b = _ref.value) == null ? void 0 : _b.focus
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), vue.mergeProps({
ref_key: "_ref",
ref: _ref,
class: [vue.unref(ns).b()]
}, vue.unref(_props), {
disabled: vue.unref(_disabled),
onClick: vue.unref(handleClick),
onMousedown: vue.unref(handleMousedown)
}), {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createTextVNode(vue.toDisplayString(vue.unref(_text)), 1)
])
]),
_: 3
}, 16, ["class", "disabled", "onClick", "onMousedown"]);
};
}
});
exports.default = _sfc_main;