Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera

uno-de-piera/posts.vue

Last active Feb 21, 2019
Embed
What would you like to do?
<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
You can’t perform that action at this time.