0

I am struggling to get any implementation of the @valueChange event working in a Vue component.

I have added it to one of the 'official' tutorials here, but I only get errors.

All I want is to log/alert a message when the selected value from search changes.

Here you can see me trying to add the event, on line 24: https://codesandbox.io/s/4z4vy9zpw

Thanks!

user1525612
  • 1,864
  • 1
  • 21
  • 33

1 Answers1

1

Try this

@valueChange="
  (function(value) {
    this.console.log('current value:', value)
  })($event)
"

Or

// template

@valueChange="handleValue"

// script

methods: {
  ...
  handleValue (value) {
    console.log('current value:', value)
  }
}
User 28
  • 4,863
  • 1
  • 20
  • 35