I want to use the tag nuxt-link to display some A tag with attribute href.But one of them need be authorized before jump to another page,maybe show a login dialog.
How can I do it?
I tried the solution below but it didn't work
template:
<nuxt-link :to="{name: 'developer-manage'}" @click.native="checkLogin($event)">test</nuxt-link>
script:
checkLogin (e) {
e.preventDefault()
},
Though,I solved the problem with this way:
<a :href="$router.resolve({name: 'developer-manage'}).href" @click="checkLogin($event)">test</a>
I hope nuxt-link can provide a better way to do that
This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c8491.