Created
September 7, 2018 20:47
-
-
Save kuroski/f1350323e45e3e6d3e552accc794e6bd to your computer and use it in GitHub Desktop.
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
<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