This file contains 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> | |
<div id="e3" style="width: 500px; max-width: 600px"> | |
<v-toolbar color="pink"> | |
<v-toolbar-side-icon></v-toolbar-side-icon> | |
<v-toolbar-title>Formulario de posts</v-toolbar-title> | |
<v-spacer></v-spacer> | |
</v-toolbar> | |
<v-card> | |
<v-container fluid grid-list-lg> | |
<v-layout row wrap> | |
<v-flex xs12> | |
<v-card color="blue-grey darken-2" class="pa-4 white--text"> | |
<v-card-title primary-title> | |
<div> | |
<div class="headline">Añade un nuevo post</div> | |
</div> | |
</v-card-title> | |
<div> | |
<v-form ref="postForm" lazy-validation> | |
<v-select | |
v-model="post" | |
:items="posts" | |
item-text="title" | |
item-value="id" | |
label="Selecciona un post" | |
></v-select> | |
</v-form> | |
</div> | |
</v-card> | |
</v-flex> | |
</v-layout> | |
</v-container> | |
</v-card> | |
</div> | |
</template> | |
<script> | |
import Post from '@/database/models/Post'; | |
export default { | |
name: 'PostsFormComponent', | |
data () { | |
return { | |
posts: [], | |
post: null, | |
} | |
}, | |
mounted () { | |
this.posts = Post.all() | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment