Skip to content

Instantly share code, notes, and snippets.

@code-machina
Last active December 11, 2018 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-machina/4ea5e76c9ddf58b23df8fad56b3a3e60 to your computer and use it in GitHub Desktop.
Save code-machina/4ea5e76c9ddf58b23df8fad56b3a3e60 to your computer and use it in GitHub Desktop.
[nuxt] Links and Navigating Around : nuxt-link
<!-- 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>
<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