[英]ReactiveSearch onValueSelected
I have the following autocomplete setup that connects to my datasource:我有以下连接到我的数据源的自动完成设置:
<ReactiveBase
app="XXXXX"
credentials="XXXXX"
>
<DataSearch
componentId="title"
:dataField="[
'name',
'symbol',
]"
className="data-search"
:showClear="false"
queryFormat="and"
/>
</ReactiveBase>
I would like to just alert the value of the the selection, whenever I select one of the autocomplete suggestions.每当我选择自动完成建议之一时,我只想提醒选择的值。
I have tried adding the following:我尝试添加以下内容:
onValueSelected = {
function (value) {
alert(value)
}
}
But I get a Duplicate attribute '}'
error但我得到一个Duplicate attribute '}'
错误
I am using Vue.我正在使用 Vue。
Thanks!谢谢!
Instead of onValueSelected
use @valueSelected
.而不是onValueSelected
使用@valueSelected
。 Check Event handling in Vue here .在此处检查 Vue 中的事件处理。
You can also check this link .您也可以查看此链接。 I have updated the basic demo of DataSearch component present on docs to use valueSelected
.我已经更新了文档上存在的 DataSearch 组件的基本演示以使用valueSelected
。
You can read about the other events in DataSearch component here .您可以在此处阅读 DataSearch 组件中的其他事件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.