Skip to content

Commit 62c82ef

Browse files
committed
feat: Add text prop to CButton component to allow self closing syntax
1 parent e9fba74 commit 62c82ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/Button/CButton.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const btnProps = {
2323
pressed: {
2424
type: Boolean,
2525
default: null
26-
}
26+
},
27+
text: String
2728
}
2829
export const props = assign(linkPropsFactory(), btnProps)
2930

@@ -83,11 +84,13 @@ export default {
8384
}
8485
}
8586
}
87+
const domProps = children ? '' : { innerHTML: props.text }
8688
const componentData = {
8789
staticClass: 'btn',
8890
class: computeClasses(props),
8991
props: computePassedProps(props),
9092
attrs: computeAttrs(props, data, isButton, toggle),
93+
domProps,
9194
on
9295
}
9396
return h(isButton ? 'button' : CLink , mergeData(data, componentData), children)

0 commit comments

Comments
 (0)