Skip to content

Commit ee5eacc

Browse files
committed
feat(button): apply ctx.attr on button tag
1 parent 63ab83d commit ee5eacc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

devui/button/button.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import './button.scss';
99

1010
export default defineComponent({
1111
name: 'd-button',
12+
inheritAttrs: false,
1213
props: {
1314
id: {
1415
type: [String, Number]
@@ -108,6 +109,7 @@ export default defineComponent({
108109
disabled={disabled}
109110
style={{ width: width }}
110111
onClick={onClick}
112+
{...ctx.attrs}
111113
// dLoading
112114
// [showLoading]="showLoading"
113115
// [loadingTemplateRef]="loadingTemplateRef"

devui/button/demo/primary/primary.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ export default defineComponent({
66
setup() {
77
return () => {
88
return (
9-
<div>
10-
<Button bsStyle="primary">primary</Button>
9+
<div style="display:flex;">
10+
<Button bsStyle="primary" style="margin-right: 4px">primary</Button>
11+
<Button bsStyle="primary" disabled>Disabled</Button>
1112
</div>
1213
);
1314
}

0 commit comments

Comments
 (0)