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

问题描述 投票:0回答:1

我很难在Vue组件中使用@valueChange事件的任何实现。

我已将其添加到此处的“官方”教程之一,但我只会收到错误。

我想要的是在搜索中选定的值发生变化时记录/提醒消息。

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

谢谢!

vue.js reactivesearch
1个回答
1
投票

试试这个

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

要么

// template

@valueChange="handleValue"

// script

methods: {
  ...
  handleValue (value) {
    console.log('current value:', value)
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.