回答編集履歴
1
URLをリンクに
answer
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
私も以前同じことを考えてやってみたことがあります。
|
2
2
|
|
3
|
-
https://github.com/vuejs/vue-router/blob/dev/src/index.js#L35
|
3
|
+
[https://github.com/vuejs/vue-router/blob/dev/src/index.js#L35](https://github.com/vuejs/vue-router/blob/dev/src/index.js#L35)
|
4
4
|
vue-router のコンストラクタは `RouterOptions` という型で定義されたデータを受け取ります。
|
5
5
|
|
6
6
|
そして `RouterOptions` の型の定義はこのようになっています。
|
7
|
-
https://github.com/vuejs/vue-router/blob/dev/types/router.d.ts#L49-L63
|
7
|
+
[https://github.com/vuejs/vue-router/blob/dev/types/router.d.ts#L49-L63](https://github.com/vuejs/vue-router/blob/dev/types/router.d.ts#L49-L63)
|
8
8
|
|
9
9
|
`beforeEach` は `RouterOptions` の定義に存在しないのでvue-routerのコンストラクタは何もしないというわけです。
|