vue-twentytwenty icon indicating copy to clipboard operation
vue-twentytwenty copied to clipboard

vue 3 isn't support

Open YumiSuki opened this issue 3 years ago • 3 comments

I have tried it on Vuejs 3 today and got some exception.

Uncaught TypeError: Cannot read property 'component' of undefined
    at Module.fb15 (index.js:4)
    at __webpack_require__ (bootstrap:19)
    at bootstrap:83
    at bootstrap:83
    at chunk-S7VG5LVE.js?v=3cd53d8e:6
    at dep:vue-twentytwenty:1

Here is my code:

import 'vue-twentytwenty/dist/vue-twentytwenty.css'; // css or no still got the same error
import TwentyTwenty from 'vue-twentytwenty';

export default {
  // ...
  components: {
    TwentyTwenty
  }
  // ...
};

Any idea how to fix this please.

YumiSuki avatar May 07 '21 15:05 YumiSuki

Hey @YumiSuki, there's v3 support now, check it out!

lyqht avatar Dec 23 '21 10:12 lyqht

Hello @lyqht,

Currently, I have moved to Nuxt 3 and it's still got some error.

TypeError: Cannot read properties of undefined (reading "component") vue

I have tried fixing the problem by replacing:

import Vue from 'vue';
import TwentyTwenty from './TwentyTwenty.vue';

Vue.component('TwentyTwenty', TwentyTwenty);

export default TwentyTwenty;

With this instead and it's working:

import { createApp } from 'vue';
import TwentyTwenty from './TwentyTwenty.vue';
const app = createApp({});


app.component('TwentyTwenty', TwentyTwenty);
export default TwentyTwenty;

ref: solution

YumiSuki avatar Jan 01 '22 04:01 YumiSuki

@YumiSuki How did you manage to make it work with Nuxt? Can you provide more instructions please? Thanks

simoroma avatar Apr 21 '23 10:04 simoroma