foxford / wc-poll

https://netology-group.js.org/wc-poll/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

https://netology-group.js.org/wc-poll/


Languages

Language:JavaScript 70.8%Language:CSS 20.1%Language:HTML 9.1%