Vue: vue-router route

Explanation

  Time learning as much as possible open to official documents

  Vue Router is Vue.js official route manager. It Vue.js and core depth of integration, so that to build single-page application a breeze. Capabilities include:

  • Nested routing / table view
  • Modular, component-based routing configuration
  • Routing parameters, queries, wildcard
  • Based on the view transition effects Vue.js transition system
  • Fine-grained control navigation
  • CSS class with automatic activation link
  • HTML5 historical patterns or hash mode, automatic demotion in IE9
  • Since the definition of the scroll bar behavior

installation

  Based on the first vue-clitest of learning; vue-router to see whether there node_modules

  vue-router is a plug-in package, so we need to use npm / cnpm to install. Open a command-line tool, into your project directory, enter the following command.

    npm install vue-router --save-dev

  If you use it in a modular project, it must pass Vue.use () explicitly install routing functions:

  

test

1. Configure Route inlet disposed main.js

 2. Writing custom components

3. Configure Route Forwarding

4. Use

 

Start test: npm run dev

How to find a path through the router corresponding components of it? Simply draw a road map

 

Detailed study, please go to the official document viewing

Guess you like

Origin www.cnblogs.com/FondWang/p/12345383.html