Last active
February 21, 2019 07:00
-
-
Save uno-de-piera/66f7e6876df99215a799745b08d98313 to your computer and use it in GitHub Desktop.
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