1.0.5 • Published 5 years ago

@updivision/vue-easy-polls v1.0.5

Weekly downloads
15
License
MIT
Repository
github
Last release
5 years ago

vue-easy-polls

A Vue.js component for creating polls, voting and showing results. It’s easy to implement and easy to customize.

Demo

See live demo here

Prerequisites

Installing

Using npm:

$ npm i @updivision/vue-easy-polls

Example (NPM)

<template>
  <div id="app">
    <poll-creator savePollUrl="post-poll-url" />
    <hr>
    <poll-view getPollUrl="get-poll-url" saveVoteUrl="post-save-url"/>
  </div>
</template>

<script>
import {PollView, PollCreator} from '@updivision/vue-easy-polls'

export default {
    name: 'app',
    components: {
        PollCreator,
        PollView
    }
}
</script>

Customize

<template>
  <div id="app">
    <poll-creator savePollUrl="post-poll-url" />
    <hr>
    <poll-view getPollUrl="get-poll-url" saveVoteUrl="post-save-url"/>
  </div>
</template>

<script>
import {PollView, PollCreator} from '@updivision/vue-easy-polls'

export default {
    name: 'app',
    components: {
        PollCreator,
        PollView
    }
}
</script>

<style lang="scss">
//...
$poll-primary: red;
$poll-secondary: yellow;
@import "@updivision/vue-easy-polls/src/assets/poll.scss";
//...
</style>

Poll Attributes

PollCreate.vue

AttributeDescriptionAccepted valuesHTTP verbRequiredDefault
savePollUrlThis is the endpoint where your server will save the current pollURL (string)POSTrequired-

PollView.vue

AttributeDescriptionAccepted valuesHTTP verbRequiredDefault
saveVoteUrlThis is the endpoint where your server will save the vote for the current pollURL (string)POSTrequired-
getPollUrlThis is the endpoint from where your server will return the pollURL (string)GETrequired-

Database schema example

Database schema

Screenshots

vue-easy-polls

vue-easy-polls

vue-easy-polls

Contributors

LICENSE

MIT License