@@ -5,7 +5,6 @@ var RouteTransition = require('../transition')
55module . exports = function ( Vue , Router ) {
66
77 var _ = Vue . util
8- var p = Router . prototype
98
109 /**
1110 * Add a route containing a list of segments to the internal
@@ -17,7 +16,7 @@ module.exports = function (Vue, Router) {
1716 * @param {Array } segments
1817 */
1918
20- p . _addRoute = function ( path , handler , segments ) {
19+ Router . prototype . _addRoute = function ( path , handler , segments ) {
2120 guardComponent ( handler )
2221 segments . push ( {
2322 path : path ,
@@ -44,7 +43,7 @@ module.exports = function (Vue, Router) {
4443 * @param {Object } handler
4544 */
4645
47- p . _notFound = function ( handler ) {
46+ Router . prototype . _notFound = function ( handler ) {
4847 guardComponent ( handler )
4948 this . _notFoundHandler = [ { handler : handler } ]
5049 }
@@ -56,7 +55,7 @@ module.exports = function (Vue, Router) {
5655 * @param {String } redirectPath
5756 */
5857
59- p . _addRedirect = function ( path , redirectPath ) {
58+ Router . prototype . _addRedirect = function ( path , redirectPath ) {
6059 this . _addGuard ( path , redirectPath , this . replace )
6160 }
6261
@@ -67,7 +66,7 @@ module.exports = function (Vue, Router) {
6766 * @param {String } aliasPath
6867 */
6968
70- p . _addAlias = function ( path , aliasPath ) {
69+ Router . prototype . _addAlias = function ( path , aliasPath ) {
7170 this . _addGuard ( path , aliasPath , this . _match )
7271 }
7372
@@ -79,7 +78,7 @@ module.exports = function (Vue, Router) {
7978 * @param {Function } handler
8079 */
8180
82- p . _addGuard = function ( path , mappedPath , handler ) {
81+ Router . prototype . _addGuard = function ( path , mappedPath , handler ) {
8382 var router = this
8483 this . _guardRecognizer . add ( [ {
8584 path : path ,
@@ -101,7 +100,7 @@ module.exports = function (Vue, Router) {
101100 * @return {Boolean } - if true, will skip normal match.
102101 */
103102
104- p . _checkGuard = function ( path ) {
103+ Router . prototype . _checkGuard = function ( path ) {
105104 var matched = this . _guardRecognizer . recognize ( path )
106105 if ( matched ) {
107106 matched [ 0 ] . handler ( matched [ 0 ] , matched . queryParams )
@@ -118,7 +117,7 @@ module.exports = function (Vue, Router) {
118117 * @param {String } [anchor]
119118 */
120119
121- p . _match = function ( path , state , anchor ) {
120+ Router . prototype . _match = function ( path , state , anchor ) {
122121 var self = this
123122
124123 if ( this . _checkGuard ( path ) ) {
@@ -186,7 +185,7 @@ module.exports = function (Vue, Router) {
186185 * @param {Route } route
187186 */
188187
189- p . _updateRoute = function ( route ) {
188+ Router . prototype . _updateRoute = function ( route ) {
190189 this . _currentRoute = route
191190 // update route context for all children
192191 if ( this . app . $route !== route ) {
@@ -205,7 +204,7 @@ module.exports = function (Vue, Router) {
205204 * @param {String } [anchor]
206205 */
207206
208- p . _postTransition = function ( route , state , anchor ) {
207+ Router . prototype . _postTransition = function ( route , state , anchor ) {
209208 // handle scroll positions
210209 // saved scroll positions take priority
211210 // then we check if the path has an anchor
0 commit comments