0.4.2 • Published 5 years ago

@netology-group/wc-poll v0.4.2

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

Usage

Define module

UMD

<script src="pathto/dist/polyfill.js"></script>
<script src="pathto/dist/index.js"></script>
<script src="pathto/dist/poll.js"></script>
<script>
  window.onload = function(){
    var withStyleLink = window.WC.withStyleLink
    var withPoll = window.WCPoll.mixins.withPoll

    window.customElements.define(
      'wc-poll', 
      withStyleLink(
        withPoll(
          window.WC.Poll, 
          { 
            text: 'question?', 
            total: 0, 
            list:[{
              label: 'Answer',
              name: 'answer',
              value: 'Answer',
              count: 0,
            }]
          }
        ),
        'pathto/dist/poll.css'
      )
    )
  }
</script>

In HTML

Generic usage

<wc-poll></wc-poll>

How to

Demo

npm start
# generic version: http://127.0.0.1:9090

Run for development

npm run build -- --w

Build for production

NODE_ENV=production npm run build