vue-twentytwenty
vue-twentytwenty copied to clipboard
vue 3 isn't support
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.
Hey @YumiSuki, there's v3 support now, check it out!
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 How did you manage to make it work with Nuxt? Can you provide more instructions please? Thanks