【问题标题】:v-select displays object Objectv-select 显示对象 Object
【发布时间】:2020-08-29 20:28:01
【问题描述】:

我是 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-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”。

【问题讨论】:

    标签: vuex vuetify.js v-select


    【解决方案1】:

    您不必使用绑定,也无需将其与item-valueitem-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
       >
    

    【讨论】:

    • 仔细阅读您的回复后,它解决了我的问题 - 非常感谢。
    • 是的,有时很难将技术原因翻译成简单的英语。 :P,很高兴我能提供帮助。
    猜你喜欢
    • 2022-06-17
    • 2020-11-22
    • 2019-02-05
    • 2021-02-09
    • 2014-12-19
    • 1970-01-01
    • 2021-03-15
    • 1970-01-01
    • 2018-05-30
    相关资源
    最近更新 更多