This article mainly introduces the detailed explanation of Vue.jsBuildingroutingError reporting router.map is not a function, very useful For practical value, friends in need can refer to
Error:
Cause of the problem : There is no map method in 2.0, only 1.0 is compatible with this method.
Solution:
(1) Method 1: Use the command npm install vue-router@0.7.13 is compatible with vue version 1.0.
How to use it in the code:
(2) Solution 2: Based on vue2.0, write the corresponding method.
The specific usage is as follows:
Note: There are big differences between 1.0 and 2.0 in some usages, so you need to pay attention when using them.
The above is the detailed content of How to solve the error when building routing in Vue.js?. For more information, please follow other related articles on the PHP Chinese website!