在 ReactiveSearch Vue 组件中寻找 @valueChange 的示例实现

Looking for an example implementation of @valueChange in a ReactiveSearch Vue component

我正在努力获得在 Vue 组件中工作的 @valueChange 事件的任何实现。

我已将其添加到此处的 'official' 教程之一,但我只收到错误。

我只想log/alert当从搜索中选择的值发生变化时收到一条消息。

在这里你可以看到我在第 24 行尝试添加事件: https://codesandbox.io/s/4z4vy9zpw

谢谢!

试试这个

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

或者

// template

@valueChange="handleValue"

// script

methods: {
  ...
  handleValue (value) {
    console.log('current value:', value)
  }
}