Vue project day10

vue-router programmed navigation Introduction

It is modified to direct the original router-link, if the modified tag has

Influence, then you can tag = "" modify our original rendering it

 

Now what we are using the click event, then you would write function

Implementation of programming navigation jump in a function

this.$router.push({ name: "goodsinfo", params: { id } });

 

Can be connected to a jump in html tag

Can be used in the BOM window.localtion.href = "www.baidu.com"

So how do we achieve this in the vue?

May be router-link

Use the form js route navigation

But why should we have this this $ router.push ({name: "goodsinfo", params: {id}});. It?

 

 

console.log(this)

Under this method are

 

 

 

Guess you like

Origin www.cnblogs.com/Py-king/p/11620789.html