简体   繁体   English

Vuetify v-select输入元素不包含任何值

[英]Vuetify v-select input element does not hold any value

I am using a typical Vuetify's v-select component like this: 我正在使用典型的Vuetify的v-select组件,如下所示:

<v-select 
    :name="search['type']" 
    v-model="type" 
    :items="typeOptions" 
    label="Type"
>
</v-select>

where typeOptions is an array like this: 其中typeOptions是这样的数组:

typeOptions: [
  { text: 'Residential', value: 'residential' },
  { text: 'Commercial', value: 'commercial' },
  { text: 'Land', value: 'land' },
  { text: 'Other', value: 'other' },
]

The problem is that while v-model holds the appropriate value, the input element with name search['type'] that is created does not hold any value, so I cannot include this v-select component in a form that I want to submit. 问题是,尽管v-model保留适当的值,但是创建的名称为search['type']的输入元素不包含任何值,因此我无法以我要提交的形式包含此v-select组件。

Check my codepen here . 在这里检查我的codepen。

I could use a workaround here, by inserting a hidden input depending on this v-model but I don't find it the cleanest solution and in any case I think this should work properly and I cannot understand why it doesn't. 我可以在这里使用一种解决方法,方法是根据此v-model插入隐藏的输入,但是我找不到它是最干净的解决方案,无论如何我都认为这应该可以正常工作,但我不明白为什么不这样做。

Thanks for any help. 谢谢你的帮助。

It seems that currently Vuetify currently doesn't support regular form inputs for select, checkboxes and radio inputs. 看来目前Vuetify目前不支持用于选择,复选框和单选输入的常规表单输入。 That means when someone is trying to submit them to a server, nothing will be submitted. 这意味着当有人尝试将其提交到服务器时,将不会提交任何内容。

This feature is planned to be added on Vuetify 1.1 with the refactoring of input controls. 计划通过重构输入控件在Vuetify 1.1上添加此功能。 More information on the issue here . 关于这个问题的更多信息这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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