Skip to content

Instantly share code, notes, and snippets.

@VitorLuizC
Last active August 29, 2018 02:17
Show Gist options
  • Select an option

  • Save VitorLuizC/0069dc4461182cf861388e0511dcb314 to your computer and use it in GitHub Desktop.

Select an option

Save VitorLuizC/0069dc4461182cf861388e0511dcb314 to your computer and use it in GitHub Desktop.
<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