I am learning Vue.js, and, following a tutorial, a is used to route the page to another. He used a button wrapped by this tag, and I found that using the routing directive inside the tag. I was wondering, what's the difference between this two ways of going from one page to another? Both of them seems to be producing the same behavior (and I am not sending or receiving any data when changing pages).
Codes for comparison:
Using v-btn
<v-btn :to="{name: 'songs-create'}"
dark medium right bottom fab absolute
class="pink" slot="action">
<v-icon>add</v-icon>
</v-btn>
Using router-link
<router-link :to="{name: 'Hello'}" tag="span" class="logo">Tab Tracker</router-link>
Thanks in advance!
What is routing? Routing is the process of connecting various networks simultaneously. Routing, therefore, happens in the network layer. Routing process involves setting a path for data packets to move in a network or across multiple networks. Routers operate at Layer 3 of the OSI Model or the network layer.
v-btn is a component of vuetifyjs whereas router-link is component of vue-router. When you use v-btn with to attribute by passing the path object, it internally uses the vue-router's router-link component's api. So v-btn wraps the functionality of router-link when it is used with to attribute.
But in scenario where different Vlans wants to communicate .Router is required to route traffic between different Vlans . General by default different Vlan traffic won't communicate to each other . To make them accessable router or any layer3 device is mandate to route tràffic among VLANs
While discussing about protocols, two terms are commonly used: routing protocols and routed protocols. A Routed Protocol is a network protocol which can be used to send the user data from one network to another network.
v-btn
is a component of vuetifyjs whereas router-link
is component of vue-router.
When you use v-btn
with to
attribute by passing the path object, it internally uses the vue-router's router-link component's api.
So v-btn wraps the functionality of router-link when it is used with to
attribute.
The reason why he could have been used the v-btn
is to accomplish some other stuff like button styles and handling other events etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With