Skip to content

Commit 5968bee

Browse files
committed
improve(opts-helpers): remove $addMiddlewareContext
1 parent 49ac1aa commit 5968bee

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/install.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,10 @@ export const install: Install<Router | PluginOptions> = (
6666
context = { ..._context, app }
6767
return context
6868
}
69-
vue.$addMiddlewareContext = (key: string, value: any) => {
69+
vue.$updateMiddlewareContext = (key: string, value: any) => {
7070
const { to, from, redirect, app } = context
7171
context = { [key]: value, to, from, redirect, app }
7272
}
73-
vue.$updateMiddlewareContext = (key: string, value: any) => {
74-
if (key === 'app') {
75-
throw new BasePluginError(
76-
'cannot update internal context property, `key`'
77-
)
78-
}
79-
context[key] = value
80-
}
8173

8274
/* istanbul ignore next */
8375
const routeHook: RouteHook = (

0 commit comments

Comments
 (0)