简体   繁体   中英

How to achieve programatic routing in Nuxt?

Nuxt comes with pre-configured router out of the box and we can use <NuxtLink to="/about" prefetch>About page</NuxtLink> . However, how to achieve programmatic routing?

The question seems to have a simple and straightforward answer. But sometimes, we end up surfing the web for a long time and landing up on not what we are looking for a lot of time.

Answer to this question is simple. You can do it in a same way as you do it in normal vue.js app using this.$router.push .

this.$router.push({ path: val });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM