feat: add button style

This commit is contained in:
zhuzhengjian 2023-03-17 15:53:26 +08:00
parent 6c7f67df60
commit c0666f2553

View File

@ -7,6 +7,10 @@ const Button = defineComponent({
props: { props: {
prefixCls: { prefixCls: {
type: String type: String
},
type: {
type: String,
default: 'default'
} }
}, },
setup(props, { slots, attrs }) { setup(props, { slots, attrs }) {
@ -16,6 +20,7 @@ const Button = defineComponent({
return () => { return () => {
const cls = { const cls = {
[prefixCls.value]: true, [prefixCls.value]: true,
[`${prefixCls.value}-${props.type}`]: !!props.type,
[hashId.value]: true [hashId.value]: true
} }
return wrapSSR(<button class={[cls, attrs.class]}>{slots.default?.()}</button>) return wrapSSR(<button class={[cls, attrs.class]}>{slots.default?.()}</button>)