diff --git a/src/components/link.js b/src/components/link.js index ec724ba97..6eeb1bd94 100644 --- a/src/components/link.js +++ b/src/components/link.js @@ -12,6 +12,8 @@ const eventTypes: Array = [String, Array] const noop = () => {} let warnedCustomSlot +let warnedTagProp +let warnedEventProp export default { name: 'RouterLink', @@ -128,6 +130,23 @@ export default { } } + if (process.env.NODE_ENV !== 'production') { + if (this.tag && !warnedTagProp) { + warn( + false, + `'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.` + ) + warnedTagProp = true + } + if (this.event && !warnedEventProp) { + warn( + false, + `'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.` + ) + warnedEventProp = true + } + } + if (this.tag === 'a') { data.on = on data.attrs = { href, 'aria-current': ariaCurrentValue }