有没有一种方法可以观察使用使用输入属性的Q-Select的内容?

发布于 2025-02-09 20:02:14 字数 386 浏览 0 评论 0原文

请问有什么方法可以观看具有使用输入属性的Q输入的文本内容?

我想为地址创建一个自动完成栏。首先,我尝试了分开的Q输入和Q-Select,它起作用了:我观看了Q输入的V模型,并使用它来获取使用自动完整的API的地址建议,然后在Q-Select上显示它们。

但是我想合并Q输入和Q-select,因此我在Q-select中添加了use-Input,但是现在,当我输入一些文本时,v-Model上的观察器不会触发在Q选择中。那么,如何查看用户类型的每个字符的Q-select内容的内容呢?

我看到的唯一解决方案是保留两个组件,文本输入的Q输入以及选择结果的Q-Select,样式看起来像Q-select具有Q-Select,with use-Input属性:/

谢谢您的帮助:)

Is there a way to watch the text content of a q-input with use-input attribute, please ?

I want to create an autocomplete bar for addresses. First I tried with a separated q-input and q-select and it worked : I watch the v-model of my q-input and I use it to fetch addresses suggestions with my autocomplete API, then I display them on the q-select.

But I want to merge the q-input and q-select, so I added use-input to my q-select, but now the watcher on its v-model is not triggered when I type some text in the q-select. So how can I watch content of q-select with use-input for every character the user type ?

The only solution I see is to keep the two components, a q-input for text entry, and the q-select for selecting results, with style to look like a q-select with use-input attribute :/

Thank you for your help :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

快乐很简单 2025-02-16 20:02:14

您应该使用范围a v-slot
<模板V-Slot:no-option =“ scope”>
然后,您在模板中有scope.inputValue

You should use the scope a the v-slot:
<template v-slot:no-option="scope">
then you have ur scope.inputValue in the template.

没︽人懂的悲伤 2025-02-16 20:02:14

Finnaly我发现Q-Select有一个 @Input-Value事件

Finnaly I found q-select has an @input-value Event

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文