Skip to content

Instantly share code, notes, and snippets.

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