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

Question: How to use programmatically in Nuxt? #19

Open
cliqer opened this issue Jun 23, 2019 · 2 comments
Open

Question: How to use programmatically in Nuxt? #19

cliqer opened this issue Jun 23, 2019 · 2 comments

Comments

@cliqer
Copy link

cliqer commented Jun 23, 2019

Works perfectly in template as a component but need to use it as variable within another component.
Tried it as a constructor in mounted and computed but still no luck.
Can you please help me?
https://codesandbox.io/s/ckybh?fontsize=14
Many Thanks

@reflexator
Copy link

reflexator commented Apr 23, 2020

Dont use it as component

https://codesandbox.io/s/vue-typed-js-e8uil

<template>
<div>
  <h2 ref="useTypedHere"></h2>

   <button @click="clickToUseTyped()">Click to type</button>
</div>
</template>
<script>
import Typed from 'typed.js'
export default {
  methods: {
    clickToUseTyped() {
        new Typed(this.$refs.useTypedHere, {
          strings: ['Some text or variable here']
        })
     }
  }
}
</script>

@cliqer
Copy link
Author

cliqer commented Apr 24, 2020

@reflexator thank you for this; it actually works using refs but it doesn't in my example.

I am trying to use typed as iView's -> Select -> :placeholder without luck.

It must have to do of how the custom Select component works within iView but I can't understand what the problem is and how to fix.

Many thanks for your help.

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

2 participants