Home > Web Front-end > JS Tutorial > How to solve the error when building routing in Vue.js?

How to solve the error when building routing in Vue.js?

零下一度
Release: 2017-06-29 15:46:25
Original
1913 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template