Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change in 3.5 #85

Closed
adrium opened this issue Oct 14, 2024 · 5 comments
Closed

Breaking change in 3.5 #85

adrium opened this issue Oct 14, 2024 · 5 comments
Assignees

Comments

@adrium
Copy link

adrium commented Oct 14, 2024

Hi, this following code used to work in 3.4: https://jsfiddle.net/d3ugkhaw/

Whereas it does not display any qr code in 3.5: https://jsfiddle.net/Ld42fm8z/

How should the snipped be adjusted to make it work in 3.5?

@scopewu
Copy link
Owner

scopewu commented Oct 15, 2024

Thanks a lot for the feedback, this issue is due to exporting the QrcodeCanvas and QrcodeSvg components independently in version 3.5 for easy standalone use.Yes, the rollup.js configuration has been changed:

// rollup.config.js

-    exports: 'default',
+    exports: 'named',

For the error you are reporting, you can use the default attribute, which I will refine in the documentation.

Vue.createApp({
  data() { return {
    value: 'https://example.com',
    test: 'Hello World'
  }},
  components: {
    QrcodeVue: QrcodeVue.default,
  },
}).mount('#root')

非常感谢反馈问题,这个问题是由于在 3.5 版本中独立导出 QrcodeCanvasQrcodeSvg 组件,方便独立使用。是的,修改了 rollup 配置。

针对您的报错,可以使用 default 属性,我会在文档中完善说明。

@scopewu scopewu self-assigned this Oct 15, 2024
@adrium
Copy link
Author

adrium commented Oct 16, 2024

Thanks a lot for the explanation, it worked.

@adrium adrium closed this as completed Oct 16, 2024
@adrium
Copy link
Author

adrium commented Oct 16, 2024

Sorry, I need to reopen and I discovered why my code is not working anymore (I actually did figure out using QrcodeVue.QrcodeCanvas when inspecting the object)

Adding margin="0" breaks:

3.4: https://jsfiddle.net/4y0htd9x/

3.5: https://jsfiddle.net/ets2z0o3/

@adrium adrium reopened this Oct 16, 2024
@scopewu
Copy link
Owner

scopewu commented Oct 16, 2024

This is due to the data type problem. Try to use :margin='0'. I will change it to forced type conversion.

scopewu added a commit that referenced this issue Oct 17, 2024
@adrium
Copy link
Author

adrium commented Oct 19, 2024

Great, works now!

@adrium adrium closed this as completed Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants