Last active
August 29, 2018 02:17
-
-
Save VitorLuizC/0069dc4461182cf861388e0511dcb314 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
| <section> | |
| <search-users-form :types="types" @search="search($event)" /> | |
| <v-data-table | |
| :items="users" | |
| :headers="[ | |
| { text: 'ID', value: 'id' }, | |
| { text: 'Nome', value: 'name' }, | |
| { text: 'E-Mail', value: 'email' }, | |
| { text: 'Cargo', value: 'position' } | |
| ]" | |
| /> | |
| </section> | |
| </template> | |
| <script> | |
| import SearchUsersForm from '@/components/SearchUsersForm.vue'; | |
| import searchUsers, { getTypes } from '@/modules/search-users.js'; | |
| export default { | |
| components: { SearchUsersForm }, | |
| data () { | |
| return { | |
| users: [], | |
| types: [] | |
| }; | |
| }, | |
| methods: { | |
| async search (params) { | |
| this.users = await searchUsers(params); | |
| } | |
| }, | |
| async mounted () { | |
| this.types = await getTypes(); | |
| } | |
| }; | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment