From: Eduardo San Martin Morote Date: Sun, 23 Aug 2020 10:27:29 +0000 (+0200) Subject: fix(types): add HTML attributes for JSX X-Git-Tag: v4.0.0-beta.8~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06f3f8fd7c3a32da331802fe5d3d19ced17200a3;p=thirdparty%2Fvuejs%2Frouter.git fix(types): add HTML attributes for JSX Close #435 --- 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()