Created
December 24, 2019 22:07
-
-
Save NAKKA-K/95fd8f6579f09d3d636ca2a876cb12d2 to your computer and use it in GitHub Desktop.
Nuxtでnuxt-linkの中に別の操作をするボタンを配置した時にうまく動作させる方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<v-btn @click="(e) => $emit('click', e)"> | |
<slot></slot> | |
</btn> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<nuxt-link to="/another"> | |
<p>別ページに遷移する</p> | |
<primary-btn @click.prevent="() => alert('click button')"> | |
アラートを出す | |
</btn> | |
</nuxt-link> | |
</template> | |
<script> | |
import PrimaryBtn from '~/components/atoms/PrimaryBtn.vue' | |
export default { | |
components: { | |
PrimaryBtn | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment