VueJS: "once" event modifier, check if clicked
P粉541551230
P粉541551230 2024-02-25 15:18:09
0
1
400

I have a simple question that I haven't answered so far.

In VueJS, there is .once event modifier, which can work normally. The problem is that I'm using @click.once on the autocomplete input component to query my database and populate its available items.

What I want to achieve is to provide some kind of additional icon to call the query after clicking the input once.

Because:

  • I want to prevent users from spamming click input and making lots of queries
  • I want him to be able to refresh the data using a "refresh icon" that will only show up when my input is clicked once (@click.once triggered).

Is there a way to obtain this information?

Thanks in advance!

P粉541551230
P粉541551230

reply all(1)
P粉043295337

I think you should create a state (data) that is set to false and when the button is clicked it changes to false. Then conditionally display the refresh icon with the set value. Click Refresh to reset the value to false.



Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!