File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default defineComponent({
20
20
props : breadcrumbItemProps ,
21
21
emits : [ 'click' ] ,
22
22
slots : [ 'separator' , 'overlay' ] ,
23
- setup ( props , { slots } ) {
23
+ setup ( props , { slots, emit } ) {
24
24
const { prefixCls } = useConfigInject ( 'breadcrumb' , props ) ;
25
25
/**
26
26
* if overlay is have
@@ -41,11 +41,14 @@ export default defineComponent({
41
41
return breadcrumbItem ;
42
42
} ;
43
43
44
+ const handleClick = ( e : MouseEvent ) => {
45
+ emit ( 'click' , e ) ;
46
+ } ;
47
+
44
48
return ( ) => {
45
49
const separator = getPropsSlot ( slots , props , 'separator' ) ?? '/' ;
46
50
const children = getPropsSlot ( slots , props ) ;
47
51
let link : JSX . Element ;
48
-
49
52
if ( props . href !== undefined ) {
50
53
link = < a class = { `${ prefixCls . value } -link` } > { children } </ a > ;
51
54
} else {
@@ -55,7 +58,7 @@ export default defineComponent({
55
58
link = renderBreadcrumbNode ( link , prefixCls . value ) ;
56
59
if ( children ) {
57
60
return (
58
- < span >
61
+ < span onClick = { handleClick } >
59
62
{ link }
60
63
{ separator && < span class = { `${ prefixCls . value } -separator` } > { separator } </ span > }
61
64
</ span >
You can’t perform that action at this time.
0 commit comments