我是vuetify的新手,我对如何正确使用v-select感到困惑。我正在将选择值从API拖到名为FormatTypes的商店中,该商店看起来像这样:
[{"id":5,"formatlabel":"RDBMS Table or View"}
,{"id":6,"formatlabel":"Microsoft Access"}
....
,{"id":23,"formatlabel":"ArcGIS for Server image services"}]
我的v选择:
<v-select font-weight-regular subtitle-1
v-model=dataset.formattypeid
:name="FormatTypes"
:items="FormatTypes"
:item-value="FormatTypes.id"
:item-text="FormatTypes.formatlabel"
:label="FormatTypeLbl"
:outlined=true
>
我使用了item-text / item-value道具,但我仍在显示中显示“对象Object”。
答案 0 :(得分:0)
您不必使用绑定,也不需要将其与item-value
和item-text
中的项目链接回
<v-select font-weight-regular subtitle-1
v-model=dataset.formattypeid
:name="FormatTypes"
:items="FormatTypes"
item-value="id" // No need of binding and no need of FormatTypes linking
item-text="formatlabel" // No need of binding and no need of FormatTypes linking
:label="FormatTypeLbl"
:outlined=true
>