From: Eduardo San Martin Morote Date: Fri, 24 Apr 2020 15:42:37 +0000 (+0200) Subject: refactor: Link and View renamed to RouterLink and RouterView X-Git-Tag: v4.0.0-alpha.8~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=030bbc4c3f68d29a9e9d23ee01603394427427a3;p=thirdparty%2Fvuejs%2Frouter.git refactor: Link and View renamed to RouterLink and RouterView 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 --- diff --git a/__tests__/RouterLink.spec.ts b/__tests__/RouterLink.spec.ts index 34cf3adc..5afdf43d 100644 --- a/__tests__/RouterLink.spec.ts +++ b/__tests__/RouterLink.spec.ts @@ -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, diff --git a/__tests__/RouterView.spec.ts b/__tests__/RouterView.spec.ts index 8409fffe..d150a498 100644 --- a/__tests__/RouterView.spec.ts +++ b/__tests__/RouterView.spec.ts @@ -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' diff --git a/src/components/Link.ts b/src/components/Link.ts index b83e8fea..08a98efe 100644 --- a/src/components/Link.ts +++ b/src/components/Link.ts @@ -68,7 +68,7 @@ export function useLink(props: UseLinkOptions) { } } -export const Link = (defineComponent({ +export const RouterLink = (defineComponent({ name: 'RouterLink', props: { to: { diff --git a/src/components/View.ts b/src/components/View.ts index a88d6c3d..4d29de11 100644 --- a/src/components/View.ts +++ b/src/components/View.ts @@ -16,7 +16,7 @@ import { routeLocationKey, } from '../utils/injectionSymbols' -export const View = (defineComponent({ +export const RouterView = (defineComponent({ name: 'RouterView', props: { name: { diff --git a/src/index.ts b/src/index.ts index 38b92cc3..9dd78ee9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 } diff --git a/src/install.ts b/src/install.ts index 204af6e7..1617cebd 100644 --- a/src/install.ts +++ b/src/install.ts @@ -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