简体   繁体   中英

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

I am using Vue.

Thanks!

Instead of onValueSelected use @valueSelected . Check Event handling in Vue here .

You can also check this link . I have updated the basic demo of DataSearch component present on docs to use valueSelected .

You can read about the other events in DataSearch component here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM