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

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

零下一度
零下一度Original
2017-06-29 15:46:251837browse

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!

Statement:
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