privatenumber / vue-2-3

↔️ Interop Vue 2 components in Vue 3 apps and vice versa
MIT License
281 stars 10 forks source link

Error in render: "TypeError: Cannot read property '1' of undefined" #4

Open nuochong opened 3 years ago

nuochong commented 3 years ago

vue2 components

<template>
  <div>
    <button @click="test()">
      Open full screen modal! (With teleport!)
    </button>
  </div>
</template>

vue3 use

import toVue3 from 'vue-2-3/to-vue-3';
import Vue2 from 'vue2';
import * as Vue3 from 'vue';

toVue3.register(Vue2, Vue3);
import HelloWorld from '../../../vue-test-2/src/components/HelloWorld'
let hello = toVue3(HelloWorld)
export default {
  name: 'Home',
  components: {
    HelloWorld:hello
  }
}

dom image

error image

version win10 x64 vue@^3.0.2 vue@^2.6.12

privatenumber commented 3 years ago

Thanks for the issue @nuochong

I tried reproducing your error here but it seems to work fine.

Can you provide a CodePen reproduction or a minimal reproduction repo?