In Nuxt and Vuetify application, I have a series of buttons:
<v-btn dark color="orange" href="className/studentName" nuxt>
<v-icon large left>favorite</v-icon>
studentName
</v-btn>
I want to refactor this code knowing that I get className from the route: $route.params.className And I get studentName from a normal JavaScript array.
When I type href={{$route.params.className}}/studentName I get an error:
Use v-bind or the colon shorthand instead. For example, instead of
, use .
And when I do it that way:
:href="$route.params.className/studentName"
I get this error instead:
Invalid prop: type check failed for prop "href". Expected String, Object, got Number.
So how to define correctly my href prop without hard writing className (I mean I want to use $route.params.className in order to refactor my code which has several buttons?