I am facing an issue with creating a router-link in Vue and passing a route name as a prop. What I am trying to achieve is the following:
<template>
<div>
<router-link :to="myProps">Login</router-link>
</div>
</template>
<script>
export default {
name: componentName,
props: {
myProps: {
type: String,
default: '{ name: login }'
}
}
}
</script>
The 'Login' route is defined in my router, but when I pass the route as a prop, it redirects me to /%7B%20name:%20'login'%20%7D
. Is there any workaround for this issue?