]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
feat: expose symbols as internals
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 20 Nov 2020 17:47:39 +0000 (18:47 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 20 Nov 2020 17:47:49 +0000 (18:47 +0100)
Allow integration for testing utils and other library-level integrations with vue router. These are marked as internal and should not be used by unofficial integrations as they could change at any time.

src/index.ts
src/injectionSymbols.ts

index caca8b13eface359b63dfddcd2e2357503f6b053..bd3036a345d5f8f85c2b4f4ef7698fc5b26935d7 100644 (file)
@@ -20,7 +20,12 @@ export {
   _PathParserOptions,
 } from './matcher/pathParserRanker'
 
-export { routeLocationKey, routerKey } from './injectionSymbols'
+export {
+  routeLocationKey,
+  routerKey,
+  matchedRouteKey,
+  viewDepthKey,
+} from './injectionSymbols'
 
 export {
   RouteMeta,
index 457f1ea14ae2bad1d2cf94a9b65a1002b4427f0d..b23ea5e376772022280a27865a078627ccf97b2f 100644 (file)
@@ -13,10 +13,23 @@ export const PolySymbol = (name: string) =>
     : (__DEV__ ? '[vue-router]: ' : '_vr_') + name
 
 // rvlm = Router View Location Matched
+/**
+ * RouteRecord being rendered by the closest ancestor Router View. Used for
+ * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
+ * Location Matched
+ *
+ * @internal
+ */
 export const matchedRouteKey = /*#__PURE__*/ PolySymbol(
   __DEV__ ? 'router view location matched' : 'rvlm'
 ) as InjectionKey<ComputedRef<RouteRecordNormalized | undefined>>
-// rvd = Router View Depth
+
+/**
+ * Allows overriding the router view depth to control which component in
+ * `matched` is rendered. rvd stands for Router View Depth
+ *
+ * @internal
+ */
 export const viewDepthKey = /*#__PURE__*/ PolySymbol(
   __DEV__ ? 'router view depth' : 'rvd'
 ) as InjectionKey<number>