Vue-router: addRoutes() does not populate the value of router.options.routes

Created on 29 Oct 2018  路  3Comments  路  Source: vuejs/vue-router

Version

3.0.1

Reproduction link

https://jsfiddle.net/50wL7mdz/774018/

Steps to reproduce

  1. open link
  2. press run
  3. open console

What is expected?

The console should show an array of three routes, including the '/foobar' one

What is actually happening?

The console shows an array of two routes

Most helpful comment

I dont get it why it is the expected behaviour.
Can you explaint it a little more?
How can i access all the current routes? (obviously including the newly added one)

All 3 comments

This is expected: the options object doesn't change over time

I dont get it why it is the expected behaviour.
Can you explaint it a little more?
How can i access all the current routes? (obviously including the newly added one)

i have the same problem with you
do you solve? why addRoutes() not change router.options.routes

Was this page helpful?
0 / 5 - 0 ratings