npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-trip

v0.1.14

Published

Vue Trip is a lightweight and customizable plug-in that allows an easy and efficient way to guide your users in your application

Downloads

154

Readme

Vue Trip

Vue Trip is a lightweight and customizable plug-in that allows an easy and efficient way to guide your users in your application.

Getting Started

Install vue-trip using npm.

npm install vue-trip

Then import the plugin at the application start point (main.js if you have created your application via Vue-cli).

import Vue from 'vue'
import App from './App.vue'
import VueTrip from 'vue-trip'

require('vue-trip/dist/vue-trip.css')

Vue.use(VueTrip)

new Vue({
  render: h => h(App)
}).$mount('#app')

Add the <v-trip /> component to your file by passing the type through a configuration object.

<template>
  <div> 
    <v-trip ref="trip" :configs="configs" :stages="stages" />
  </div>
</template>
  • type - Defines the behavior of the guide.
    • popup-steps - Default behavior
    • popup-frame-steps - It maintains the default behavior, with the addition of a dark background that delimits the area of ​​the target object of the stage.
  • theme - The color used by the guide, you can use light for a light theme and dark for a dark theme.
  • spacing - Adds a spacing between the component and the card. If you are using popup-frame-steps this spacing will be applied to the frame as well.
<script>
export default {
  name: 'Test-Vue-Trip',
  data() {
    return {
      configs: [
        {
          type: 'popup-steps',
          theme: 'light',
          spacing: 4,
        },
      ],
    }
  },
};
</script>

Now we will use the data-v-stage property on the objects that we want our guide to interact with.

<template>
  <div>
    <input data-v-stage="example1" type="button" value="Button for example" />
    <input data-v-stage="example2" type="button" value="Other button for example" />
  
    <v-trip ref="trip" type="popup-steps" :stages="stages" />
  </div>
</template>

In the data property of your file we will create a variable stages and in it we will pass all the configurations of the stages that our guide will have.

  • target - Object referring to that stage of the guide.
  • position - Where the card will be positioned relative to its target object.
  • ignore - If true will skip this stage and continue the cycle.
  • title - Title to be displayed on the head of card.
  • content - Content that will be shown in the body of the card (accepts html tags).
  • buttons - Interaction buttons that will be shown on the card's bottom.
    • label - Label that will be shown without button.
    • color - Button fill color.
    • action - Interaction functions next, previous, skip, finish, goTo::(Index of the stage you want to go. ex: 0 ) with the guide (accepts custom functions) <String/Function>
<script>
export default {
  name: 'Test-Vue-Trip',
  data() {
    return {
      configs: [
        {
          type: 'popup-steps',
          theme: 'light',
        },
      ],
      stages: [
        {
          target: 'example1',
          title: 'Button Example',
          content: 'This is a button of example.',
          buttons: [
            { label: 'Next', color: '#3498db', action: 'next' },
            { label: 'Skip', color: null, action: 'skip' },
            { label: 'Go To', color: null, action: 'goTo::0' },
            { label: 'Custom function', color: null, action: () => {
                return alert('Custom function :D')
              }
            },
          ],
        },
      ],
    }
  },
};
</script>

Finally we will create the method that will execute the guide by calling the go function.

export default {
  name: 'Test-Vue-Trip',
  data() {
    return {
      configs: [
        {
          type: 'popup-steps',
          theme: 'light',
        },
      ],
      stages: [
        {
          target: 'example1',
          title: 'Button Example',
          content: 'This is a button of example.',
          buttons: [
            { label: 'Next', color: '#3498db', action: 'next' },
            { label: 'Skip', color: null, action: 'skip' },
          ],
        },
        {
          target: 'example2',
          title: 'Another Button Example',
          content: 'This is another button of example.',
          buttons: [
            { label: 'Previous', color: '#3498db', action: 'previous' },
            { label: 'Finish', color: '#27ae60', action: 'finish' },
            { label: 'Skip', color: null, action: 'skip' },
          ],
        },
      ],
    }
  },
  mounted() {
    this.start();
  },
  methods: {
    start() {
      this.$refs.trip.go();
    },
  },
};