问题标签 [v-autocomplete]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
vue.js - 如何测试一个 vue vuetify v-autocomplete
不知何故,我无法在测试期间看到html 内部items
的v-autocomplete
内容,并且设置项目也不起作用。v-autocomplete
在(正在加载安装上的项目)和测试下方。
测试看起来像这样:
测试expect(getByText(wrapper.element, item.name)).toBeTruthy();
将失败并显示消息Unable to find an element with the text
。打印 htmlconsole.log(wrapper.html())
也不会显示v-autocomplete
. 所以我的问题是:
- 如果物品已加载,我该如何测试?
- 如何将加载的一项设置为 的选定项
v-autocomplete
?
javascript - vue.js - 测试 v-autocomplete 的观察者
我有一个带有v-autocomplete
. 它有select
和的观察者search
:
我正在测试它如下。我希望两个观察者都应该开火。事实上,只有select
观察者被解雇了。search
观察者没有。
Search
有什么通过考试的想法吗?
vuetify.js - 当我单击任意位置时,Vuetify v-select 不会关闭
为什么当我单击任何地方时f*** 是 vuetifyv-select
或不关闭?v-autocomplete
更糟糕的是,没有任何关于它的文档。这只是纯粹的烦人,真的需要时间来弄清楚。
遇到同样问题的人可以帮助我吗?
编辑: 我现在发现有人有同样的问题 https://codepen.io/kaps-pavel/pen/qBdRrwX?editors=1010
但是对于这个问题没有任何解决方案。
javascript - Vuetify 的 v-autocomplete 组件在清除时将 v-model 值重置为 null
在下面的代码中,我使用了一个 v-autocomplete 组件和一个select
存储所选值的变量。记录的watch
值和类型select
。我面临的问题是,当清除 v-autocomplete 中键入的文本时,select
默认为 null 而不是空字符串。有没有办法恢复select
为空字符串而不是空对象?
vue.js - Using cypress, how to select an item on a `` if it has too many items
While writing a E2E test for a Vuetify page using Cypress, I ran into difficulties selecting one or more elements from either a <v-select>
or a <v-autocomplete>
The answer to a preexisting question works okay as long as there are only a few options on the select.
The problem is: if your component has many options selected, Vuetify will only render the options that are close to the corresponding scrollbar position on its popup, meaning that the option you need to select may not be visible and is therefore, not selectable via Cypress.
Does anyone know a reliable way to access an element on a Vuetify <v-select>
/<v-autocomplete>
even if the select has too many options?
vue.js - 如何限制 v-autocomplete 中下拉结果的数量?
Image Link我从 axios api 收到 100-200 个结果。我只想显示其中的前 10 个。有什么办法我可以做到这一点。我不能从 api 做到这一点,因为我还想显示从 axios 返回的总项目数。
编辑:我有一个显示所有按钮,它显示新弹出窗口中所有项目的列表。因此,我想要返回的总项目的确切计数,但只想显示其中的前 10 个结果。
javascript - 更改样式 active v-autocomplete
如果至少选择了一项,我如何更改 v-autocomplete 的样式(边框颜色)?如果焦点在字段上,现在样式会更改(蓝色),但如果选择项目并且焦点不在字段上,则变为默认(灰色)。移除焦点后我需要保持蓝色边框我尝试更改 css 但没有成功
vue.js - Nuxt/Vuetify - v-autocomplete not displaying the v-menu
Edit2: I found out the answer to this, you might also miss this one out if you're just starting on vuetify, or that you just directly dive into it and integrate it into an existing project without reading its documentation like me . Vuetify won't work if it's not inside the application tag or <v-app>
tag. So make sure if you're using a layout, that you wrap your code inside the v-app
tag, the stylings may apply, but the functionalities won't work if you did not wrap using the application tag.
Original Question:
I can't seem to be able to make the the v-autocomplete
work in any of my project, I tried it in 2 different projects, one installed using npm
, and the other installed using the nuxt-create
. I even copied the code from their demo on their website, but that didn't work too. These are the package version for each project:
and
I can see the v-menu
and the list in my array when I inspect element but it has a default style of display: none;
, and because of that, even if I clicked or start typing, the array of supposed autocompletes wouldn't show.
So my question would be, how do I make it to work like how it's supposed to work in the demo on their website?
Edit1: I found out a little quirk about this, It would now work, but only on pages with default layout. So when I set a custom layout, like this one, layout: 'sidebar-layout',
on the /device page, the v-autocomplete
's dropdown would never open, unless I set the div
class v-menu
using element inspector in my browser. I haven't yet found out what's causing this, could either be in the layout or the component called into it.
javascript - vuetify中是否有v-autocomplete“无数据过滤”回调?
当 vuetify.js 过滤器中的 v-autocomplete 显示“无可用数据”时,有什么方法可以捕获事件?我在这里找不到这个事件https://vuetifyjs.com/en/api/v-autocomplete/#events 也许蜜蜂有一些解决方法?蜜蜂我可以得到过滤结果并检查它是否为NULL?