0.10.0 • Published 7 years ago

@imjohnbon/polls-test v0.10.0

Weekly downloads
-
License
-
Repository
-
Last release
7 years ago

easy-static-polls

Install

NPM

First, install easy-static-polls via your preferred package manager:

$ npm install easy-static-polls --save

Then register any relevant components in your JavaScript:

import Vue from 'vue'
import { Poll, RenderlessPoll } from 'easy-static-polls'

Vue.component('poll', Poll)
Vue.component('renderless-poll', RenderlessPoll)

Now you can use the components in your markup:

<poll :choices="{ 'banana': 'Banana', 'apple': 'Apple' }"></poll>

CDN

Simply include vue & easy-static-polls.js - we recommend using unpkg.

<script src="https://unpkg.com/vue@latest"></script>
<!-- use the latest release -->
<script src="https://unpkg.com/easy-static-polls@latest"></script>
<!-- or point to a specific release -->
<script src="https://unpkg.com/easy-static-polls@1.0.0"></script>

Then register any relevant components in your JavaScript:

Vue.component('poll', easyStaticPolls.Poll);
Vue.component('renderless-poll', easyStaticPolls.RenderlessPoll);

Now you can use the components in your markup:

<poll :choices="{ 'banana': 'Banana', 'apple': 'Apple' }"></poll >

Here's an example on JSBin.

Usage

Props

NameTypeDefault ValueDescription
afterSubmitHookFunctionEmpty functionDescription
allowCustomAnswerBooleanfalseNotification's body message. Normally should be set up
buttonTextString'Submit Answer'time before notifications gone
choicesObjectEmpty objectCallback function
customAnswerLabelObjectEmpty objectCallback function
endpointStringundefinedCallback function
fieldGoalFormKeyStringundefinedCallback function
multipleChoiceBooleanfalseCallback function
onSubmitErrorHookFunctionEmpty functionCallback function
requestConfigObjectEmpty objectCallback function
thankYouMessageString'Your answer has been submitted.'Callback function
0.10.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago