0👍
I know it’s too late but,I suggest this method.In fact,%20 replaces the space in your link.I suggest that you should remove all the spaces in your link before routing to it:
As an example
<script>
export default{
methods:{
VisitLink(name) {
this.$router.push(name.trim().replace(/ /g, "-
").toLowerCase());
},
}
}
</script>
I use the method trim() to make sure that there is not any space at the end of country name. Then,I remove the all the remaining space in NAME.
But,if you still want to use nuxtJs link you can create a method like
<script>
export default{
methods:{
getLink(name){
return name.trim().replace(/ /g, "-
").toLowerCase()
}
}
}
</script>
and then
<nuxt-link :to="getLink(country.name)"><span>Learn more...</span></nuxt-link>
I hope,it could help someone
- [Vuejs]-[Vue warn]: Unknown custom element: <v-xxxxxx>
- [Vuejs]-Incomprehensible "Uncaught TypeError: Cannot read property 'removeChild' of null" error
Source:stackexchange.com