Giter Site home page Giter Site logo

vue-driver's Introduction

vue-driver.js

VueDriver is a Vue plugin for driver.js, a tool to help drive the users focus

Installation

> npm install vue-driver.js

Use

import Vue from "vue";
import VueDriver from "vue-driver.js";

Vue.use(VueDriver);

// The rest of your Vue code
...

Directives

driver-step

Adds v-driver-step directive

it accepts an object that is structured like this:

{
  popover: {
    title: String,
    description: String,
    position: String,
    showButtons: Boolean,
    closeBtnText: String,
    nextBtnText: String,
    prevBtnText: String
  },
  index: Number,
  onclick: Boolean
}

where the object types represent the type of the parameter

Note: if you specify the same index more than one step, it will choose whichever one binds last to have that position

Example

Without value

<div v-driver-step>
  Hi, I'm some content!
</div>

With value

<div v-driver-step="{ popover: {title: 'Hey', description: 'Im a popover'} }">
  Hi, I'm some content!
</div>

Mixins

vue-driver has two mixins as of now

$startTour( index: Number )

$startTour is a component mixin that starts a tour, if you've supplied steps through the v-driver-step attribute.

Note: You must stop event propigation on your button's click event. See here for an example

Example

Bad

<button @click="$startTour">start tour</button>

Good

<button @click.stop="$startTour">start tour</button>

$driver

The $driver mixin exposes the current driver instance, so that you can use the driver.js api directly till i can write more useful mixins.

vue-driver's People

Contributors

ianfabs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.