{"record":{"id":"d6cffe0625b81260","repo":"vuejs/vue-router","slug":"router-link-s-tag-prop-is-deprecated-and-has-bee","errorCode":null,"errorMessage":"<router-link>'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props","messagePattern":"<router-link>'s tag prop is deprecated and has been removed in Vue Router 4\\. Use the v-slot API to remove this warning: https://next\\.router\\.vuejs\\.org/guide/migration/#removal-of-event-and-tag-props","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/components/link.js","lineNumber":136,"sourceCode":"      }\n      if (scopedSlot.length === 1) {\n        return scopedSlot[0]\n      } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n        if (process.env.NODE_ENV !== 'production') {\n          warn(\n            false,\n            `<router-link> with to=\"${\n              this.to\n            }\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.`\n          )\n        }\n        return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n      }\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      if ('tag' in this.$options.propsData && !warnedTagProp) {\n        warn(\n          false,\n          `<router-link>'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.`\n        )\n        warnedTagProp = true\n      }\n      if ('event' in this.$options.propsData && !warnedEventProp) {\n        warn(\n          false,\n          `<router-link>'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.`\n        )\n        warnedEventProp = true\n      }\n    }\n\n    if (this.tag === 'a') {\n      data.on = on\n      data.attrs = { href, 'aria-current': ariaCurrentValue }\n    } else {","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/vuejs/vue-router/blob/680ccc68c506cca9be6207745043245d61fa715a/src/components/link.js#L118-L154","documentation":"This is a dev-only deprecation warning: the event prop of <router-link> (which changed the click event, e.g. event=\"mouseover\") is removed in Vue Router 4. The v-slot API replaces it by exposing navigate so you can bind navigation to any event yourself. Fires once (warnedEventProp flag) when event is present in propsData.","triggerScenarios":"Passing event=\"...\" (or an array of events) to <router-link> on a vue-router 3.x next/4 migration build in dev mode.","commonSituations":"Code from vue-router 3 that made links navigate on hover or custom events; migration to vue-router 4 without updating router-link usage.","solutions":["Remove the event prop and use v-slot with custom, calling navigate in whatever event handler you want.","For default behavior, rely on the built-in click handling and drop the prop entirely.","For non-click navigation triggers, call router.push directly from your own handler."],"exampleFix":"// before\n<router-link to=\"/about\" event=\"mouseover\">About</router-link>\n// after\n<router-link to=\"/about\" custom v-slot=\"{ href, navigate }\">\n  <a :href=\"href\" @mouseover=\"navigate\">About</a>\n</router-link>","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove tag and event props during vue-router 4 migration; grep codebase for '<router-link' usages with tag=/event=.","Replace tag with v-slot + custom rendering.","Replace event with @event=\"navigate\" via the v-slot navigate function.","Run the app in dev mode during migration so these one-time warnings surface."],"tags":["vue-router","router-link","deprecation","migration","vue-router-4"],"backgroundTag":"router-link-event-prop-removed","analyzedSha":"680ccc68c506cca9be6207745043245d61fa715a","analyzedAt":"2026-09-02T19:19:01.204Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}