vue-currency-input icon indicating copy to clipboard operation
vue-currency-input copied to clipboard

CompositionAPI setup() method not called in 2.1.3+

Open sindrepm opened this issue 3 years ago • 4 comments

Vue Currency Input version

2.2.0

Vue version

2.6

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction link

https://codesandbox.io/s/stoic-grothendieck-dyyn5

Describe your issue

After upgrading to the latest version my custom component no longer works because the setup() method is not called. I traced the bug back to being introduced with the 2.1.3 release (also occurs with 2.2.0).

If I downgrade to 2.1.2 it works fine.

I have installed @vue/composition-api 1.4.1.

I'm also using Nuxt, although I don't think that should matter?

sindrepm avatar Dec 02 '21 11:12 sindrepm

Vue Currency Input does not work in a CodeSandbox in combination with Vue 2 for some reason, but the Vue 2 example works as expected with v2.2.0.

Please provide a minimal reproduction repo for your issue. Thanks!

dm4t2 avatar Dec 03 '21 20:12 dm4t2

i have this issue too, the composition api setup method not called, it caused ...method "formattedValue" is not defined on....

webowodev avatar Dec 05 '21 07:12 webowodev

@dm4t2 Did some more investigation and looks like this issue is somehow related to Nuxt. The plain Vue example works, but I've created a minimal Nuxt repo based on the same example where the issue can be reproduced:

https://github.com/sindrepm/vue-currency-input-test

Likewise, downgrading vue-currency-input to v2.1.2 "fixes" this problem.

@daemswibowo Do you also happen to be using Nuxt?

sindrepm avatar Dec 05 '21 09:12 sindrepm

In v2.1.3, vue-demi was bumped to the latest version, probably causing the issue with Nuxt.

I managed to get @sindrepm repo work by replacing the @vue/composition-api dependency with @nuxtjs/composition-api: https://composition-api.nuxtjs.org/getting-started/setup/

I will update the docs regarding the usage with Nuxt.

dm4t2 avatar Dec 05 '21 16:12 dm4t2