Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

wan2land/vue-ab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

A/B Testing Component for Vue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published