Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events not working as expected #31

Open
isaacjoy opened this issue Mar 3, 2020 · 0 comments
Open

Events not working as expected #31

isaacjoy opened this issue Mar 3, 2020 · 0 comments

Comments

@isaacjoy
Copy link

isaacjoy commented Mar 3, 2020

Hey,

Thanks for making this plugin - it's really useful for me. The only slight problem I'm having is getting some events to fire properly.

I'm using vue-typed-js in nuxt.js and when I use the @onstart method on my component, it does not get called before starting. The same is true with @preStringTyped and @onTypingResumed, although @onComplete works strangely enough.

Here is my VueTypedJs component:

        <vue-typed-js 
        :strings="['&nbsp;page&nbsp;', '&nbsp;link&nbsp;', '&nbsp;way&nbsp;']"
        :typeSpeed="100"
        :startDelay="1000"
        :showCursor=false
        @onStart="handleStart()"
        @preStringTyped="handleStart()"
        @onTypingResumed="handleStart()"
        @onComplete="handleComplete()"
        >
            <h1 class="text-5xl font-bold">One<span class="typing"></span>.to</h1>
        </vue-typed-js>

And the methods in the component are:

        handleStart() {
            alert('started')
        },
        handleComplete() {
            alert('completed')
        }

The only alert message I see is the completed one, which is annoying because I want to append an extra space to the word I'm inserting in between 2 other words before it starts typing.

I'm using it as plugin in nuxt like so:

Typed.js

import Vue from 'vue'
import VueTypedJs from 'vue-typed-js'

Vue.use(VueTypedJs)

Nuxt.config.js

  plugins: [
    { src: '~plugins/typed.js', ssr: false },
  ],

I have a feeling it may something be to do with #29 but I'm not sure.

Thanks for any help and again thanks for building a really useful plugin,
Isaac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant