From 06f3f8fd7c3a32da331802fe5d3d19ced17200a3 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sun, 23 Aug 2020 12:27:29 +0200 Subject: [PATCH] fix(types): add HTML attributes for JSX Close #435 --- src/RouterLink.ts | 3 ++- src/RouterView.ts | 3 ++- test-dts/components.test-d.tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/RouterLink.ts b/src/RouterLink.ts index 03ba7170..6fa1a59e 100644 --- a/src/RouterLink.ts +++ b/src/RouterLink.ts @@ -7,6 +7,7 @@ import { reactive, unref, VNodeProps, + HTMLAttributes, } from 'vue' import { RouteLocationRaw, VueUseOptions, RouteLocation } from './types' import { isSameRouteLocationParams, isSameRouteRecord } from './location' @@ -186,7 +187,7 @@ export const RouterLinkImpl = defineComponent({ // also to avoid inline import() in generated d.ts files export const RouterLink = (RouterLinkImpl as any) as { new (): { - $props: VNodeProps & RouterLinkProps + $props: HTMLAttributes & VNodeProps & RouterLinkProps } } diff --git a/src/RouterView.ts b/src/RouterView.ts index 39afae54..0a50a4cf 100644 --- a/src/RouterView.ts +++ b/src/RouterView.ts @@ -9,6 +9,7 @@ import { VNodeProps, getCurrentInstance, computed, + HTMLAttributes, } from 'vue' import { RouteLocationNormalized, RouteLocationNormalizedLoaded } from './types' import { @@ -108,7 +109,7 @@ export const RouterViewImpl = defineComponent({ // also to avoid inline import() in generated d.ts files export const RouterView = (RouterViewImpl as any) as { new (): { - $props: VNodeProps & RouterViewProps + $props: HTMLAttributes & VNodeProps & RouterViewProps } } diff --git a/test-dts/components.test-d.tsx b/test-dts/components.test-d.tsx index 97d39aeb..6b970012 100644 --- a/test-dts/components.test-d.tsx +++ b/test-dts/components.test-d.tsx @@ -21,10 +21,11 @@ expectError() expectError() expectType() expectType() +expectType() expectType() expectType() // RouterView -expectType() +expectType() expectType() expectType() -- 2.47.3