Skip to content

Instantly share code, notes, and snippets.

@VitorLuizC
Last active March 4, 2018 21:38
Show Gist options
  • Select an option

  • Save VitorLuizC/1593e09d8f5cb7aaedd33fc8fb87413a to your computer and use it in GitHub Desktop.

Select an option

Save VitorLuizC/1593e09d8f5cb7aaedd33fc8fb87413a to your computer and use it in GitHub Desktop.
Componente de formulário de pesquisa de usuários.
<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