File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,10 @@ const CLink = defineComponent({
34
34
required : false ,
35
35
} ,
36
36
} ,
37
- emits : [ 'onClick ' ] ,
37
+ emits : [ 'click ' ] ,
38
38
setup ( props , { slots, emit } ) {
39
- const onClick = ( event : MouseEvent ) => {
40
- event . preventDefault ( )
41
- emit ( 'onClick' , props . href )
39
+ const handleClick = ( ) => {
40
+ emit ( 'click' , props . href )
42
41
}
43
42
return ( ) =>
44
43
h (
@@ -47,7 +46,9 @@ const CLink = defineComponent({
47
46
class : [ { active : props . active , disabled : props . disabled } ] ,
48
47
...( props . active && { 'aria-current' : 'page' } ) ,
49
48
...( props . component === 'a' && props . disabled && { 'aria-disabled' : true , tabIndex : - 1 } ) ,
50
- ...( ( props . component === 'a' || props . component === 'button' ) && { onClick : onClick } ) ,
49
+ ...( ( props . component === 'a' || props . component === 'button' ) && {
50
+ onClick : handleClick ,
51
+ } ) ,
51
52
href : props . href ,
52
53
} ,
53
54
slots . default && slots . default ( ) ,
You can’t perform that action at this time.
0 commit comments