Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created July 28, 2020 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/2917d8a026ea379074594b6e35097218 to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/2917d8a026ea379074594b6e35097218 to your computer and use it in GitHub Desktop.
<template>
<select name="genre" @change="$emit('update:genre', $event.target.value)">
<option value="">Selecciona una opción</option>
<option
v-for="item of genres"
:value="item"
:key="item"
:selected="genre === item"
>
{{ item }}
</option>
</select>
<input
:value="email"
@input="$emit('update:email', $event.target.value)"
type="email"
name="email"
/>
<input
:value="password"
@input="$emit('update:password', $event.target.value)"
type="password"
name="password"
/>
</template>
<script>
const genres = [
'Hombre',
'Mujer',
]
export default {
name: 'LoginForm',
props: {
genre: {
type: String,
default: ''
},
email: {
type: String,
default: ''
},
password: {
type: String,
default: ''
}
},
setup () {
return {
genres,
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment