@@ -90,8 +90,8 @@ export const AutoLink = defineComponent({
9090 // If the `target` attr is "_blank"
9191 const isBlankTarget = computed ( ( ) => linkTarget . value === '_blank' )
9292
93- // Render `<RouteLink>` or not
94- const renderRouteLink = computed (
93+ // Whether the link is internal
94+ const isInternal = computed (
9595 ( ) => ! withProtocol . value && ! isBlankTarget . value ,
9696 )
9797
@@ -122,15 +122,15 @@ export const AutoLink = defineComponent({
122122 } )
123123
124124 // If this link is active
125- const isActive = computed ( ( ) =>
126- renderRouteLink . value
127- ? config . value . activeMatch
125+ const isActive = computed (
126+ ( ) =>
127+ isInternal . value &&
128+ ( config . value . activeMatch
128129 ? new RegExp ( config . value . activeMatch , 'u' ) . test ( route . path )
129130 : // If this link is active in subpath
130131 shouldBeActiveInSubpath . value
131132 ? route . path . startsWith ( config . value . link )
132- : route . path === config . value . link
133- : false ,
133+ : route . path === config . value . link ) ,
134134 )
135135
136136 return ( ) : VNode => {
@@ -143,15 +143,14 @@ export const AutoLink = defineComponent({
143143 after ?.( ) ,
144144 ]
145145
146- return renderRouteLink . value
146+ return isInternal . value
147147 ? h (
148148 RouteLink ,
149149 {
150150 'class' : 'auto-link' ,
151151 'to' : link ,
152152 'active' : isActive . value ,
153153 'aria-label' : linkAriaLabel . value ,
154- // Class needs to be merged manually
155154 } ,
156155 ( ) => content ,
157156 )
0 commit comments