Skip to content

Instantly share code, notes, and snippets.

@LazyFatArrow
Last active May 27, 2019 22:31
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 LazyFatArrow/cf45f7e27b9fe5ee5baae7af8c18b761 to your computer and use it in GitHub Desktop.
Save LazyFatArrow/cf45f7e27b9fe5ee5baae7af8c18b761 to your computer and use it in GitHub Desktop.
<template>
<b-container v-if="polls && polls.length" class="my-5">
<b-row>
<b-col>
<b-btn>Create Poll</b-btn>
</b-col>
</b-row>
<b-row class="mt-3">
<b-col>
<b-card-group columns>
<b-card
v-for="poll in polls"
:key="`poll-${poll.id}`"
:title="poll.title"
:sub-title="poll.description"
>
<b-form-group>
<b-form-radio-group
:id="`poll-options-${poll.id}`"
stacked
>
<b-form-radio
v-for="option in poll.options"
:key="`option-${option.id}`"
:value="option.id"
>
{{option.name}} - {{option.votes}}
</b-form-radio>
</b-form-radio-group>
</b-form-group>
</b-card>
</b-card-group>
</b-col>
</b-row>
</b-container>
</template>
<script>
import { POLLS } from '@/gql/queries/poll.queries'
export default {
apollo: {
polls: {
query: POLLS,
}
},
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment