vue-ab
v0.2.0
Published
A/B Testing Component for Vue.js
Downloads
22
Readme
Vue AB
A/B Testing Component for Vue2.
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>