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

No emits on vue 2.7.10 & nuxt

Open BorisKamp opened this issue 11 months ago • 5 comments

Vue Currency Input version

3.0.5

Vue version

2.7.10

What browser are you using?

Chrome

What operating system are you using?

OSX

Reproduction link

https://example.com

Describe your issue

Hi! I've setup according to the guide, I created a CurrencyInput.vue component with the following content:

<template>
  <input ref="inputRef" type="text" class="input__input" />
</template>

<script>
import { useCurrencyInput } from 'vue-currency-input'

export default {
  name: 'CurrencyInput',

  props: {
    value: {
      type: Number,
      default: 0,
    },
    options: {
      type: Object,
      default: () => {
        return {
          currency: 'EUR',
        }
      },
    },
  },

  setup(props) {
    const { inputRef } = useCurrencyInput(props.options)

    return { inputRef }
  },
}
</script>

I then use it in my other component: <currency-input ref="inp" id="input-price" :v-model="price" placeholder=" " @change="priceChanged" />

But @change is never called, so no emits. What am I doing wrong here? It clearly states the following in the guide:

By default, the number value is automatically emitted on each input

BorisKamp avatar Jul 18 '23 16:07 BorisKamp