Skip to content

Instantly share code, notes, and snippets.

@kuroski
Created September 7, 2018 20:47
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 kuroski/f1350323e45e3e6d3e552accc794e6bd to your computer and use it in GitHub Desktop.
Save kuroski/f1350323e45e3e6d3e552accc794e6bd to your computer and use it in GitHub Desktop.
<script>
import { mapState } from 'vuex'
import VUserSearchForm from '@/components/VUserSearchForm'
import VUserProfile from '@/components/VUserProfile'
export default {
name: 'UserView',
components: {
VUserSearchForm,
VUserProfile,
},
methods: {
searchUser(username) {
this.$store.dispatch('SEARCH_USER', { username })
}
},
computed: {
...mapState({
user: 'user',
})
}
}
</script>
<template>
<div>
<VUserSearchForm
@submitted="searchUser"
/>
<VUserProfile :user="user" />
</div>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment