0.2.0 • Published 7 years ago

vue-ab v0.2.0

Weekly downloads
31
License
MIT
Repository
github
Last release
7 years ago

Vue AB

vue-js downloads npm-version

A/B Testing Component for Vue2.

Demo

Installation

npm install vue-ab --save

Usage

ES6

import Vue from 'vue'
import vAb from 'vue-ab'

Vue.component('v-ab', vAb)

Globals

<html>
<head>
  ...
</head>
<body>
  <div id="app">
    <Ab
        @sample="(value) => candidate = value"
        :weight="{candidate1: 100, candidate2: 100, candidate3: 10, candidate4: 10}"
    >
        <div slot="candidate1">
            Candidate 1, (weight = 100)
        </div>
        <div slot="candidate2">
            Candidate 2, (weight = 100)
        </div>
        <div slot="candidate3">
            Candidate 3, (weight = 10)
        </div>
        <div slot="candidate4">
            Candidate 4, (weight = 10)
        </div>
        <div slot="candidate5">
            Candidate 5, (weight = 0), Never
        </div>
    </Ab>
  </div>

  <script src="path/to/vue.js"></script>
  <script src="path/to/vue-ab.js"></script>
  <script>
    Vue.component('v-ab', VueAb);
    new Vue({
      el: '#app'
    })
  </script>
</body>
</html>
0.2.0

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago