UNPKG

@arco-design/web-vue

Version:

Arco Design Vue 2.0: A Vue.js 3 UI Library

51 lines (50 loc) 1.25 kB
import { defineComponent, toRefs, provide, reactive, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue"; import { getPrefixCls } from "../_utils/global-config.js"; import { buttonGroupInjectionKey } from "./context.js"; import _export_sfc from "../_virtual/plugin-vue_export-helper.js"; const _sfc_main = defineComponent({ name: "ButtonGroup", props: { type: { type: String }, status: { type: String }, shape: { type: String }, size: { type: String }, disabled: { type: Boolean } }, setup(props) { const { type, size, status, disabled, shape } = toRefs(props); const prefixCls = getPrefixCls("btn-group"); provide( buttonGroupInjectionKey, reactive({ type, size, shape, status, disabled }) ); return { prefixCls }; } }); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock("div", { class: normalizeClass(_ctx.prefixCls) }, [ renderSlot(_ctx.$slots, "default") ], 2); } var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { ButtonGroup as default };