]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: Link and View renamed to RouterLink and RouterView
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 24 Apr 2020 15:42:37 +0000 (17:42 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 24 Apr 2020 15:42:37 +0000 (17:42 +0200)
BREAKING CHANGE: exported components Link and View have been renamed to be
include the _Router_ prefix and to have the same export name as their component
name

__tests__/RouterLink.spec.ts
__tests__/RouterView.spec.ts
src/components/Link.ts
src/components/View.ts
src/index.ts
src/install.ts

index 34cf3adc6b8098fe5f4e5a875faa1328e438685c..5afdf43dd06f6660cfcc0483a854464686e7d5df 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * @jest-environment jsdom
  */
-import { Link as RouterLink } from '../src/components/Link'
+import { RouterLink } from '../src/components/Link'
 import {
   START_LOCATION_NORMALIZED,
   RouteQueryAndHash,
index 8409fffe921446cc2c393bf0ca4c107a5c94116d..d150a49890349e084810ba18d1e153e7c057bf8f 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * @jest-environment jsdom
  */
-import { View as RouterView } from '../src/components/View'
+import { RouterView } from '../src/components/View'
 import { components, RouteLocationNormalizedLoose } from './utils'
 import { START_LOCATION_NORMALIZED } from '../src/types'
 import { markRaw } from 'vue'
index b83e8feae03d20463b668864841b144362ccdc3b..08a98efe59e0f214413f085c40b03b47f4fff7da 100644 (file)
@@ -68,7 +68,7 @@ export function useLink(props: UseLinkOptions) {
   }
 }
 
-export const Link = (defineComponent({
+export const RouterLink = (defineComponent({
   name: 'RouterLink',
   props: {
     to: {
index a88d6c3df60d9063641196e4554ed3f9f98e4d86..4d29de11d36abc05a11afa72f461b04a3af21def 100644 (file)
@@ -16,7 +16,7 @@ import {
   routeLocationKey,
 } from '../utils/injectionSymbols'
 
-export const View = (defineComponent({
+export const RouterView = (defineComponent({
   name: 'RouterView',
   props: {
     name: {
index 38b92cc3f477d2c580e878c1ee7b5178cc6f1fa8..9dd78ee9f17f526f2757d49a6847b8dc9da952f3 100644 (file)
@@ -38,8 +38,8 @@ export {
 export { NavigationFailureType, NavigationFailure } from './errors'
 
 export { onBeforeRouteLeave } from './navigationGuards'
-export { Link, useLink } from './components/Link'
-export { View } from './components/View'
+export { RouterLink, useLink } from './components/Link'
+export { RouterView } from './components/View'
 
 export { createWebHistory, createMemoryHistory, createWebHashHistory }
 
index 204af6e7b6dacb045c7ec34a6aa3082ddde28f9b..1617cebdcfbdb467812fa23c5e6057e7bf6892ed 100644 (file)
@@ -1,7 +1,7 @@
 import { App, ComputedRef, reactive } from 'vue'
 import { Router } from './router'
-import { Link } from './components/Link'
-import { View } from './components/View'
+import { RouterLink } from './components/Link'
+import { RouterView } from './components/View'
 import { isBrowser } from './utils'
 import {
   START_LOCATION_NORMALIZED,
@@ -64,8 +64,8 @@ declare module '@vue/runtime-core' {
 }
 
 export function applyRouterPlugin(app: App, router: Router) {
-  app.component('RouterLink', Link)
-  app.component('RouterView', View)
+  app.component('RouterLink', RouterLink)
+  app.component('RouterView', RouterView)
 
   // TODO: add tests
   app.config.globalProperties.$router = router