Giter VIP home page Giter VIP logo

vue-introjs's Issues

Adding steps with .addSteps

Perhaps I'm missing something obvious, but I can't seem to get this plugin to work using the this.$intro().addSteps(steps) method. I can get it to work just fine only using the v-intro directives, but I wanted to source my steps from Vuex so that there was one central spot for step information and then I could import it into whichever components needed it and then just add id to elements.

I have an array in Vuex that looks like this:

steps: [
  {
    element: '#step1',
    intro: 'Click events to get started',
  },
  {
    element: '#step2',
    intro: `Search for your Organization's region by Zip or City`,
  },
],

And I have corresponding ids set on a pair of divs in a component. I then import the steps from Vuex. I checked that they came through with console log. In the mounted() lifecycle hook I have a pair of lines that I think should have kicked off the tour:

this.$intro().addSteps(this.steps)
this.$intro().start()

Nothing happens when I load that page and there are no errors in the console. Any ideas on what to do?

how to hear the callback onComplete in vue?

how to hear the callback onComplete in vue? would it be with watch? I need when I click the done button, it shows me that it is complete, but where is it in the vue? I'm kind of lost.

Bug report: Auto start fails on second use

I start one tour on the first landing page after login. Then after that tour is over, I send the user to another page using vue-router. The tour on that second page is not started using auto start. However, if I do a refresh on that second page, the auto-tour starts as expected.

autostart doesn't work with vue-router

I'm using 'autostart' with vue-router, but intro doesn't show after router changes, I have to refresh the whole page to show it.
I've set the 'waitTimeout' value, but it doesn't work.
vue-introjs version: 1.3.0
intro.js version: 2.9.3

IE11 / Edge bug

Using the lastest version of Vue, IE11/Edge throws a polyfill event-souce missing.

I need attribute like exitOnOverlayClick to forbid click mask exit those step

It's there any events or attribute that I can use to forbid exit steps when I click the background mask, thanks.I compared with Options Props of intro.js and find it has props named exitOnOverlayClick. Thank you for you plugin that I don't want to use intro.js in vue project.Moreover, your work totally help me shorten my time in programming new tour function.

Not working on IE 11

Vue introjs is not working correctly on IE 11. So it causes my site to display white screen. Is there any polyfills I need to add to make it work on IE/Safari?

image

options hideNext not work

this.intro = this.$intro();
this.intro.setOptions({
hideNext: true, // <-- not work, still shows the next button
hidePrev: true,
prevLabel: '上一步',
nextLabel: '下一步',
doneLabel: '完成',
showProgress: true,
showBullets: false,
exitOnOverlayClick: false,
// showButtons: false,
steps: [
{
intro: '点击按钮',
element: document.querySelector('.list-step0'),
},
{}
],
});
this.intro.start();

options is like above, but the next button is still visible.

window is not defined - nuxt

This throws an error while using with nuxt.js. Since nuxt doesn't use webpack explicitly there is no way to define it the same way.

I'm trying to declare vue-introjs as a plugins in vuex.

add update hook to vue-intro directive

Hi, i have a child component that receive a computed string to be displayed in the second step of my intro and only the default value is bound.
It would be nice if the value passed to v-intro could be updated.

Feature request: Optional auto start hook

Would be great to be able to provide a function to an auto started tour that takes an introjs instance as a parameter. That would open up the use of the whole intro.js API on auto started tours. The function could be provided a Component method.

build error

ERROR in static/js/vendor.d59fade80353c4f96b45.js from UglifyJs
Unexpected token: punc (() [./node_modules/_vue-introjs@1.1.1@vue-introjs/src/index.js:10,0][static/js/vendor.d59fade80353c4f96b45.js:2710,11]

Build failed with errors.

and
npm run dev is good

Unable to listen to any of the events

My intro of app is working correctly but I am unable to listen to events.

In mounted of main App.js I have this code:


mounted: {

	this.$intro().onbeforechange(function (targetElement) {
	    console.log("before new step"); // no output
	    console.log(targetElement); // no output
	});

	this.$intro().onchange(function (targetElement) {
	    console.log("new step"); // no output
	});

	console.log('Post intro start', this.$intro()); // this prints some instance variables
}

webpack issues

> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 95% emitting                                                                           

 WARNING  Compiled with 1 warnings                                                                                                                                                3:26:06 PM

 warning  in ./node_modules/intro.js/introjs.css

(Emitted value instead of an instance of Error) autoprefixer: /home/ghenry/src/SureVoIP-Portal/root/src/client_side/node_modules/intro.js/introjs.css:12:3: Gradient has outdated direction syntax. Replace `cover` to `farthest-corner`.

 @ ./node_modules/intro.js/introjs.css 4:14-114 13:3-17:5 14:22-122
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js

Error in mounted hook: "ReferenceError: introJs is not defined"

I'm using electron-vue, which uses vue-cli + webpack.

I've added this in src/main.js:

import VueIntro from 'vue-introjs'
Vue.use(VueIntro)

then added the plugin in webpack.renderer.config.js and `webpack.main.config.js:

plugins: [
     [...]
     new webpack.ProvidePlugin({
        introJs: ['intro.js', 'introJs']
    })
],

Then when I use the intro directives in a component, I get the error: Error in mounted hook: "ReferenceError: introJs is not defined"

Both intro.js and vue-introjs have been installed via NPM

Any ideas?

This dependency was not found

Suddenly, I started to get this error on starting my project. Earlier (few days ago) everything was fine.

This dependency was not found:

  • vue-introjs in ./src/main.js
    To install it, you can run: npm install --save vue-introjs

My current version of the package is: "vue-introjs": "^1.1.2"
Even if I execute npm install --save vue-introjs and update the package to version 1.3.1, it doesn't help.

UglifyJS issues

Hi!

I got stuck into issues when trying to minify VueIntroJs. My solution was to point to the dist file, instead of the package.json main value, "src/index.js":

	resolve: {
		alias: {
			'vue-introjs': 'vue-introjs/dist/index.min.js',

Thank you!

hints don't work at all

  1. Adding hints by using v-intro-hint:
<div v-intro-hint="'tooltip text'">
  ...
</div>
mounted() {
  this.$intro().addHints()
  this.$intro().showHints()
}

In the inspector i can see that v-intro-hint has been transpiled to data-hint but nothing else happens.

  1. Adding hints programmatically:
<div id="hint-0">
  ...
</div>
mounted() {
  const hints = [
    {
      hint: 'tooltip text',
      element: document.querySelector('#hint-0')
    }
  ]
  this.$intro.setOptions({hints})
  this.$intro().addHints()
  this.$intro().showHints()
}

In the inspector i can't even see that v-intro-hint has been transpiled to data-hint.
Then i tried:

mounted() {
  ...
  this.$intro().showHintDialog(0)
}

i got an error: item is undefined
So just in case i tried as well:

mounted() {
  ...
  console.log(document.querySelector('#hint-0'))
  setTimeout(() => {
    this.$intro().showHintDialog(0)
  }, 1000)
}

console.log() prints <div id="hint-0>..
introjs outputs error item is undefined.

introjs triggers tour on completely different view

Notice a really odd behaviour, follows this pattern:

  1. IntroJS runs the tour once my component has dynamically rendered
  2. If I press back, and go to the homepage and enter a search again it will run the tour directly on the homepage view
    image
    you can see that in localstorage first_tour is set to true which means the tour has already ran, so it should not be running at all.

Also, note how it has no elements to bind to on the homepage so it just attaches itself to the top left corner of the page, and for some reason starts on the second step.

For some reason, this is what I see when I inspect the element ... it appears to be binding to the CDN code in my index.html file, not sure if this is relevant:
image

Basic outline of my code:

watch: {
    myVar: { 
        handler: function(){
            /* only start the tour once the actual elements have finished dynamically loading in the DOM */
            /* otherwise, introJS does not have any elements to actually bind to, or gets the positions wrong */
            this.$nextTick(() => {    
                if (this.results.hits.length > 0 && !this.loggedIn && !first_tour){
                    /* dynamically load my steps */
                    this.$intro().addSteps(
                        [
                            {
                                intro: "Step 1",
                                element: this.$refs.step_1,
                                position: "right",
                                disableInteraction: true // don't let the user click inside of the highlighted element
                            },
                            {
                                intro: "Step 2",
                                element: this.$refs.step_2,
                                position: "left",
                                disableInteraction: true
                            },
                            {
                                intro: "Step 3",
                                element: this.$refs.step_3_parent.$refs.step3_child_element,
                                position: "right",
                                disableInteraction: true
                            }
                        ]
                    )
                    .setOptions({
                        exitOnOverlayClick: false, // don't let the user click "out" of the tour to exit
                        overlayOpacity: 0.5 // changed to 0.5 felt it was too dark by default
                    })
                    .start() // start the tour
                    .oncomplete(function () { // callback tour completion
                        console.log("done");
                    })
                    .onexit(function () {
                        console.log("exited"); // callback tour exit
                    });
                }
            });
        },
        deep: true,
        immediate: false // don't load the tour right away
    }

what can I do about this? Note how my code clearly specifies only create the tour if the user is not logged in or has not done the tour before (as per record in local storage).

Is there any work around to just disable the tour so that it doesn't run on other pages? I can't tell if it's loading on the homepage or just loading prematurely when its going to the next page ... still shouldn't be acting this way.

I've tried lots of things including removing steps from the introJS instance upon exit or completion, I've tried setting display:none to introJS classes on the homepage, I've tried setting introJS to null, I've also tried triggering alerts throughout the introJS instantiation but for whatever reason, this unexpected behaviour won't go away.

This unexpected behaviour appears once in a while on Chrome but occurs frequently on Safari.

Any ideas would be greatly appreciated.

vue-cli import error

vue-cli import VueIntro from 'vue-introJs'; Vue.use(VueIntro);
// error Uncaught SyntaxError: Unexpected token ( autostart.js?9e2a:29

CSS directive for helperNumberLayer

Is there a default directive to append a CSS class to the numbering layer?

Requirement
Add a default CSS customization directive for introjs-helperNumberLayer (v-intro-number-class).

Similar to..

Optionally append a CSS class to the helperLayer.
<div v-intro="'The content of tooltip'" v-intro-highlight-class="'blue-bg'"></div>

Question: onComplete

Hello, thank you so nice plugin. it really great plugin
I tired to read your document it seem likes I did not see any mention use on onComplete in methods

thank you

Nested Components

Has anyone been able to get the plugin to load steps on nested components or components which dynamically render? I have only been able to get the tour to run on parent component steps.

Not sure where I'm going wrong.

ie9 support

intro.js

if (el.dataset) {
el.dataset.intro = binding.value;
}else{
el.setAttribute("data-intro", binding.value);
}

current examples are not working

Current examples are not working and integration instruction in README.md file is also not clear. Please add some nice integration document.

v-intro-autostart.config not working

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.7.0/introjs.min.css" rel="stylesheet">
    <style type="text/css">
        .red-bg {
            background: red;
        }
        
        .blue-bg {
            background: blue;
        }
    </style>
</head>

<body>
    <div class="container" id="root">
        <br />
        <div>
            <button class="btn btn-primary" @click="startTour">Start tour</button>
        </div>
        <br />
        <div v-intro-autostart="autostart" v-intro-autostart.config="{ doneLabel: 'over!' }">>
            <h3 v-intro="'Step 1, default'">Intro step 1</h3>
            <div>
                Step 1, use of v-intro="'Message'".
            </div>
            <hr />

            <h3 v-intro="'Step 2, custom position'" v-intro-position="'top'">Intro step 2 (position "top")</h3>
            <div>
                Step 2, use of v-intro-position="'top'". <br /> Renders tooltip on the top of this element.
            </div>
            <hr />

            <h3 v-intro="'Step 3, custom priority'" v-intro-step="2">Intro step 3 (set priority)</h3>
            <div>
                Step 3, use of v-intro-step="2". <br /> This step defines step priority = 2, so intro for step #3 is rendered before step #2.
            </div>
            <hr />

            <h3 v-intro="'Step 4, tooltip class'" v-intro-tooltip-class="'red-bg'">Intro step 4 (tooltip class)</h3>
            <div>
                Step 4, use of v-intro-tooltip-class="'red-bg'". <br /> Custom CSS class for tooltip.
            </div>
            <hr />

            <h3 v-intro="'Step 5, highlight class'" v-intro-highlight-class="'blue-bg'">Intro step 5 (highlight class)</h3>
            <div>
                Step 5, use of v-highlight-tooltip-class="'blue-bg'". <br /> Custom CSS class for helper layer.
            </div>
            <hr />

            <h3 v-intro="'Step 6, scroll to'" v-intro-scroll-to="'element'">Intro step 6 (change scrollTo attribute)</h3>
            <div>
                Step 6, use of v-scroll-to="'element'". <br />
            </div>
            <hr />

            <h3 v-intro="'Step 7, disable-interaction'" v-intro-disable-interaction="true">Intro step 7 (change disable-interaction attribute)</h3>
            <div>
                Step 7, use of v-disable-interaction="true". <br />
            </div>
            <hr />

            <h3 v-intro-hint="'The hint'">A hint</h3>
            <div>
                Renders a hint
            </div>
            <hr />

            <h3 v-intro-hint="'The hint'" v-intro-hint-position="'top'">A hint (position = top)</h3>
            <div>
                Renders a hint on top of elemenet.
            </div>
            <hr />
        </div>

        <div>
            <button class="btn btn-primary" @click="showHints">Show hints</button>
        </div>
    </div>
    <script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.7.0/intro.min.js"></script>
    <script type="text/javascript" src="../node_modules/vue-introjs/dist/index.min.js"></script>
    <script type="text/javascript">
        new Vue({
            el: '#root',
            data() {
                return {
                    autostart: false,

                };
            },
            methods: {
                startTour() {
                    this.$intro().start();
                },
                showHints() {
                    this.$intro().showHints();
                },
                toggleAutostart() {
                    this.autostart = !this.autostart;
                }
            }
        });
    </script>
</body>

</html>

it is still display "Done" not replace......

import VueIntro from 'intro.js' or import VueIntro from 'vue-introjs'

Hi,

In the readme you have both:


import VueIntro from 'intro.js'; 

import VueIntro from 'vue-introjs';

I am seeing:

[Vue warn]: Error in mounted hook: "ReferenceError: intro is not defined"

after adding this to my webpack.dev.conf.js

  plugins: [
    new webpack.DefinePlugin({
      'process.env': require('../config/dev.env'),
       introJs: ['intro.js', 'introJs']
    }),

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.