Last active
March 4, 2018 21:38
-
-
Save VitorLuizC/1593e09d8f5cb7aaedd33fc8fb87413a to your computer and use it in GitHub Desktop.
Componente de formulário de pesquisa de usuários.
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> | |
| <v-form> | |
| <v-text-field v-model="term" label="Pesquisar usuário" /> | |
| <v-select v-model="type" :items="types" label="Pesquisar por" /> | |
| <v-btn @click="submit()">Pesquisar</v-btn> | |
| </v-form> | |
| </template> | |
| <script> | |
| export default { | |
| props: { | |
| types: { | |
| type: Array, | |
| default: () => [] | |
| } | |
| }, | |
| data () { | |
| return { | |
| term: '', | |
| type: this.types && this.types[0] | |
| }; | |
| }, | |
| methods: { | |
| submit () { | |
| this.$emit('search', { | |
| term: this.term, | |
| type: this.type | |
| }); | |
| } | |
| } | |
| }; | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment