Skip to content

Commit dcb7f7e

Browse files
committed
style: format
1 parent 1077c2c commit dcb7f7e

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export {
1414
Route,
1515
NavigationGuard,
1616
NavigationGuardNext
17-
} from "./router";
17+
} from './router'

types/router.d.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent
44
type Dictionary<T> = { [key: string]: T }
55
type ErrorHandler = (err: Error) => void
66

7-
export type RouterMode = "hash" | "history" | "abstract";
8-
export type RawLocation = string | Location;
9-
export type RedirectOption = RawLocation | ((to: Route) => RawLocation);
10-
export type NavigationGuardNext<V extends Vue = Vue> = (to?: RawLocation | false | ((vm: V) => any) | void) => void;
11-
7+
export type RouterMode = 'hash' | 'history' | 'abstract'
8+
export type RawLocation = string | Location
9+
export type RedirectOption = RawLocation | ((to: Route) => RawLocation)
10+
export type NavigationGuardNext<V extends Vue = Vue> = (
11+
to?: RawLocation | false | ((vm: V) => any) | void
12+
) => void
13+
1214
export type NavigationGuard<V extends Vue = Vue> = (
1315
to: Route,
1416
from: Route,

types/test/index.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Async = () => Promise.resolve({ template: '<div>async</div>' })
1313
const Hook: ComponentOptions<Vue> = {
1414
template: '<div>hook</div>',
1515

16-
beforeRouteEnter (to, from, next) {
16+
beforeRouteEnter(to, from, next) {
1717
route.params
1818
next('/')
1919
next({ path: '/' })
@@ -22,14 +22,14 @@ const Hook: ComponentOptions<Vue> = {
2222
})
2323
},
2424

25-
beforeRouteLeave (to, from, next) {
25+
beforeRouteLeave(to, from, next) {
2626
route.params
2727
next('/')
2828
next({ path: '/' })
2929
next()
3030
},
3131

32-
beforeRouteUpdate (to, from, next) {
32+
beforeRouteUpdate(to, from, next) {
3333
route.params
3434
next('/')
3535
next({ path: '/' })
@@ -49,7 +49,7 @@ const router = new VueRouter({
4949
}
5050

5151
if (from.path === '/offset') {
52-
return { selector: '#foo', offset: { x: 0, y: 100 }}
52+
return { selector: '#foo', offset: { x: 0, y: 100 } }
5353
}
5454

5555
if (to.path === '/child') {
@@ -79,7 +79,7 @@ const router = new VueRouter({
7979
asyncComponent: Async
8080
},
8181
meta: { auth: true },
82-
beforeEnter (to, from, next) {
82+
beforeEnter(to, from, next) {
8383
to.params
8484
from.params
8585
next({ name: 'home' })
@@ -102,7 +102,7 @@ const router = new VueRouter({
102102
},
103103
{ path: '/home', alias: '/' },
104104
{ path: '/foo', props: true },
105-
{ path: '/bar', props: { id: 123 }},
105+
{ path: '/bar', props: { id: 123 } },
106106
{ path: '/baz', props: (route: Route) => route.params },
107107
{ path: '*', redirect: '/' }
108108
]
@@ -125,11 +125,11 @@ const matched: RouteRecord[] = route.matched
125125
matched.forEach(m => {
126126
const path: string = m.path
127127
const components: {
128-
[key: string]: ComponentOptions<Vue> | typeof Vue | AsyncComponent
128+
[key: string]: ComponentOptions<Vue> | typeof Vue | AsyncComponent
129129
} = m.components
130130
const instances: { [key: string]: Vue } = m.instances
131131
const name: string | undefined | null = m.name
132-
const parant: RouteRecord | undefined = m.parent
132+
const parent: RouteRecord | undefined = m.parent
133133
const redirect: RedirectOption | undefined = m.redirect
134134
})
135135

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -10073,9 +10073,9 @@ typedarray@^0.0.6:
1007310073
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1007410074

1007510075
typescript@^3.5.2:
10076-
version "3.5.3"
10077-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
10078-
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==
10076+
version "3.8.3"
10077+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
10078+
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
1007910079

1008010080
uc.micro@^1.0.1, uc.micro@^1.0.5:
1008110081
version "1.0.6"

0 commit comments

Comments
 (0)