p4trykJ / typewriter-vue

Typing effect component for Vue.js
Apache License 2.0
11 stars 5 forks source link

Using component for Nuxt compiling #3

Closed shiowwj closed 2 years ago

shiowwj commented 2 years ago

Unable to use the component on Vue.

Created Plugins file ~/plugins/typewriter.js `import Vue from 'vue' import Typewriter from "typewriter-vue";

Vue.use(Typewriter, { name: 'vue-typewriter' })

console.log('plugin typewriter is locked and loaded') `

added this to nuxt.config.js

plugins: [ '~/plugins/typewriter.js' ],

Using the component on a page view:

`

` Still unable to get the component to render typewriter and i am not sure why.
desdo09 commented 2 years ago

you should use ssr false

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

p4trykJ commented 2 years ago

The reason may be SSR so you can try to use it the way @desdo09 recommends or change the plugin name to typewriter.client.js - both will result the same. More about client or server side only plugins can be found here: https://nuxtjs.org/docs/directory-structure/plugins#name-conventional-plugin.

p4trykJ commented 2 years ago

Closing this issue due to long unactivity.

dzcpy commented 2 years ago

How did you handle corejs incompatibility issues?

antoniohof commented 2 years ago

replace Vue.use(Typewriter, { name: 'vue-typewriter' })

with

Vue.component('Typewriter', Typewriter)