Vue.js route naming and named views
Mar 13, 2018 pm 02:43 PMThis time I will bring you the routingnaming and namingview of Vue.js, what are the notes of Vue.js routing naming and naming the view? , the following is a practical case, let’s take a look.
Route naming We can set a name attribute when setting the route, during the navigation process directly: to="{name: 'corresponding name'} "You can
let router = new VRouter({ mode: 'history', routes: [ { path: '/apple', component: Apple, //命名路由 name: 'applePage', } ...... ] })
When used in other places outside:
<router-link :to="{name: 'applePage'}" >to apple</router-link>
Named view
is similar to the named route above, add the specified name to the component
let router = new VRouter({ mode: 'history', routes: [ { path: '/apple', //命名视图 component: { viewA: Apple, viewB: RedApple }, //命名路由 name: 'applePage', } ...... ] })
When used in other places outside:
<router-view name="viewA"></router-view>或者<router-view name="viewB"></router-view>分别插入不同的视图
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website Other related articles!
Recommended reading:
Other operations of Vue.js routing
Vue.js single component component
The above is the detailed content of Vue.js route naming and named views. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to implement an online speech recognition system using WebSocket and JavaScript

Understand the differences and comparisons between SpringBoot and SpringMVC

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

How to implement an online reservation system using WebSocket and JavaScript

How to use JavaScript and WebSocket to implement a real-time online ordering system

JavaScript and WebSocket: Building an efficient real-time weather forecasting system

Simple JavaScript Tutorial: How to Get HTTP Status Code
