Last active
December 11, 2018 23:09
-
-
Save code-machina/4ea5e76c9ddf58b23df8fad56b3a3e60 to your computer and use it in GitHub Desktop.
[nuxt] Links and Navigating Around : 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
<!-- nuxt-link 를 사용하여 Navigate 와 Link 를 다룰 수 있음 | |
to attribute : navigate 경로를 지정--> | |
<template> | |
<section class="container"> | |
<nuxt-link to="/users">Users</nuxt-link> | |
</section> | |
</template> | |
<script> | |
import Logo from '~/components/Logo.vue' | |
export default { | |
components: { | |
Logo | |
} | |
} | |
</script> |
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> | |
<div> | |
<input type="text" v-model="userId" /> | |
<button @click="onLoadUser">Load User</button> | |
</div> | |
</template> | |
<script> | |
export default { | |
data(){ | |
return { | |
userId: '' | |
} | |
}, | |
methods: { | |
onLoadUser(){ | |
this.$router.push('/users/'+ this.userId); | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment