types: improve definitions for component transition property (#7902)

This commit is contained in:
Matthew Gamble 2020-08-15 07:54:35 +10:00 committed by GitHub
parent 9f4d420b1f
commit ec9a78a3d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -20,7 +20,7 @@ declare module 'vue/types/options' {
loading?: boolean loading?: boolean
middleware?: Middleware | Middleware[] middleware?: Middleware | Middleware[]
scrollToTop?: boolean scrollToTop?: boolean
transition?: string | Transition | ((to: Route, from: Route) => string) transition?: string | Transition | ((to: Route, from: Route | undefined) => string | Transition)
validate?(ctx: Context): Promise<boolean> | boolean validate?(ctx: Context): Promise<boolean> | boolean
watchQuery?: boolean | string[] | ((newQuery: Route['query'], oldQuery: Route['query']) => boolean) watchQuery?: boolean | string[] | ((newQuery: Route['query'], oldQuery: Route['query']) => boolean)
meta?: { [key: string]: any } meta?: { [key: string]: any }

View File

@ -79,6 +79,9 @@ options.scrollToTop = true
options.transition = 'foo' options.transition = 'foo'
options.transition = { name: 'foo' } options.transition = { name: 'foo' }
options.transition = () => 'foo' options.transition = () => 'foo'
options.transition = () => {
return { name: 'foo' }
}
// validate // validate