Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

vue 3 isn't support #22

Open
YumiSuki opened this issue May 7, 2021 · 3 comments
Open

vue 3 isn't support #22

YumiSuki opened this issue May 7, 2021 · 3 comments

Comments

@YumiSuki
Copy link

YumiSuki commented May 7, 2021

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.

@lyqht lyqht mentioned this issue Dec 9, 2021
@lyqht
Copy link
Contributor

lyqht commented Dec 23, 2021

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

@YumiSuki
Copy link
Author

YumiSuki commented Jan 1, 2022

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

@simoroma
Copy link

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

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

No branches or pull requests

3 participants