File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/coreui-vue/src/components/button Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export const CButton = defineComponent({
79
79
'click' ,
80
80
] ,
81
81
setup ( props , { emit, slots } ) {
82
+ const component = props . href ? 'a' : props . component
82
83
const handleClick = ( event : Event ) => {
83
84
if ( props . disabled ) {
84
85
return
@@ -88,7 +89,7 @@ export const CButton = defineComponent({
88
89
}
89
90
return ( ) =>
90
91
h (
91
- props . component ,
92
+ component ,
92
93
{
93
94
class : [
94
95
'btn' ,
@@ -100,10 +101,9 @@ export const CButton = defineComponent({
100
101
} ,
101
102
props . shape ,
102
103
] ,
103
- disabled : props . disabled && props . component !== 'a' ,
104
- ...( props . component === 'a' && props . disabled && { 'aria-disabled' : true , tabIndex : - 1 } ) ,
105
- ...( props . component === 'a' && props . href && { href : props . href } ) ,
106
- ...( props . component === 'button' && { type : props . type } ) ,
104
+ ...( component === 'a' && props . disabled && { 'aria-disabled' : true , tabIndex : - 1 } ) ,
105
+ ...( component === 'a' && props . href && { href : props . href } ) ,
106
+ ...( component === 'button' && { type : props . type , disabled : props . disabled } ) ,
107
107
onClick : handleClick ,
108
108
} ,
109
109
slots . default && slots . default ( ) ,
You can’t perform that action at this time.
0 commit comments