Binaryify / vue-qr

The Vue Component for Awesome-qr.js
MIT License
848 stars 121 forks source link

这个插件已经支持VUE3.X了吗,我使用时报错如下 #97

Closed zzgxx closed 2 years ago

zzgxx commented 2 years ago

[Vue warn]: Property "$createElement" was accessed during render but is not defined on instance.

[Vue warn]: Property "_self" was accessed during render but is not defined on instance.

[Vue warn]: Unhandled error during execution of render function at <VueQr color-dark="#333333" color-light="#ffffff" logo-src="" ... >

[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_c')

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_c')

image

zzgxx commented 2 years ago
<div>
<vue-qr :color-dark="data.colorDark"  :color-light="data.colorLight" :logo-src="data.logoImg" :text="data.url" :size="data.imgSize" />
</div>

import vueQr from 'vue-qr'
export default {
components: {
    vueQr,
  },
setup() {
    let data = reactive({
      url: 'https://www.*****.com',
      imgSize: 200,
      logoImg: '',
      colorDark: '#333333', // 二维码颜色
      colorLight: '#ffffff' // 二维码背景色
      // canvas: {}
    })
return{data}
}
}
zzgxx commented 2 years ago

v2.4.0支持了,import 需要改一下 import vueQr from 'vue-qr/src/packages/vue-qr.vue'

希望作者可以在文档中说明一下奥