我是个新手,我还不知道如何正确地使用v-select。我将select值从API拉到名为FormatTypes的存储中,如下所示:
[{"id":5,"formatlabel":"RDBMS Table or View"}
,{"id":6,"formatlabel":"Microsoft Access"}
....
,{"id":23,"formatlabel":"ArcGIS for Server image services"}]我的v-select:
<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 Object“。
发布于 2020-05-13 23:33:24
您不必使用绑定,也无需将其链接回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
>https://stackoverflow.com/questions/61778132
复制相似问题