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({
7979 'click' ,
8080 ] ,
8181 setup ( props , { emit, slots } ) {
82+ const component = props . href ? 'a' : props . component
8283 const handleClick = ( event : Event ) => {
8384 if ( props . disabled ) {
8485 return
@@ -88,7 +89,7 @@ export const CButton = defineComponent({
8889 }
8990 return ( ) =>
9091 h (
91- props . component ,
92+ component ,
9293 {
9394 class : [
9495 'btn' ,
@@ -100,10 +101,9 @@ export const CButton = defineComponent({
100101 } ,
101102 props . shape ,
102103 ] ,
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 } ) ,
107107 onClick : handleClick ,
108108 } ,
109109 slots . default && slots . default ( ) ,
You can’t perform that action at this time.
0 commit comments