mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
types: fix to prop typing (#8134)
This commit is contained in:
@@ -7,10 +7,10 @@ import {
|
|||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
ComponentPublicInstance,
|
ComponentPublicInstance,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import type { RouteLocation } from 'vue-router';
|
import type { RouteLocationRaw } from 'vue-router';
|
||||||
|
|
||||||
export const routeProps = {
|
export const routeProps = {
|
||||||
to: [String, Object] as PropType<RouteLocation>,
|
to: [String, Object] as PropType<RouteLocationRaw>,
|
||||||
url: String,
|
url: String,
|
||||||
replace: Boolean,
|
replace: Boolean,
|
||||||
};
|
};
|
||||||
|
1
src/vue-tsx-shim.d.ts
vendored
1
src/vue-tsx-shim.d.ts
vendored
@@ -14,5 +14,6 @@ declare module 'vue' {
|
|||||||
onClosed?: EventHandler;
|
onClosed?: EventHandler;
|
||||||
onChange?: EventHandler;
|
onChange?: EventHandler;
|
||||||
onToggle?: EventHandler;
|
onToggle?: EventHandler;
|
||||||
|
onClickStep?: EventHandler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,10 +37,10 @@ export function mockScrollIntoView() {
|
|||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mockGetBoundingClientRect(rect: DOMRect): () => void {
|
export function mockGetBoundingClientRect(rect: Partial<DOMRect>): () => void {
|
||||||
const originMethod = Element.prototype.getBoundingClientRect;
|
const originMethod = Element.prototype.getBoundingClientRect;
|
||||||
|
|
||||||
Element.prototype.getBoundingClientRect = jest.fn(() => rect);
|
Element.prototype.getBoundingClientRect = jest.fn(() => rect as DOMRect);
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
Element.prototype.getBoundingClientRect = originMethod;
|
Element.prototype.getBoundingClientRect = originMethod;
|
||||||
|
Reference in New Issue
Block a user