schlechtenburg/packages/core/lib/components/Button.tsx

33 lines
563 B
TypeScript
Raw Normal View History

2020-12-27 21:32:43 +00:00
import { defineComponent } from 'vue';
2020-12-30 20:17:34 +00:00
2020-05-27 13:57:57 +00:00
import './Button.scss';
2022-03-13 22:12:18 +00:00
/**
* A button in the schlechtenburg theme
* @sbui
*/
2020-12-30 13:34:23 +00:00
export const SbButton = defineComponent({
2020-05-27 13:57:57 +00:00
name: 'sb-button',
inheritAttrs: false,
2021-03-08 15:29:35 +00:00
setup(_, context) {
2020-05-27 13:57:57 +00:00
return () => (
<button
{...{
2020-12-30 01:32:46 +00:00
...context.attrs,
class: (context.attrs.class || '') + ' sb-button',
2020-05-27 13:57:57 +00:00
}}
>
2022-03-13 22:12:18 +00:00
{
/**
* The button contents
* @slot default
*/
context.slots.default?.()
}
2020-05-27 13:57:57 +00:00
</button>
);
},
});