ionic4 - 离子 4/5 中的离子选择选项?
问题描述
我希望将以下 JSON 绑定到 ion-select。谁能帮我完成这个。JSON看起来不错吗?
{
"1": "Lynko Pvt. Ltd. ",
"4": "Letsclick Pvt. Ltd. ",
"5": "Wirehead ",
"6": "Codeyiizen Software & Services Pvt. Ltd. ",
"7": "Mariao Barando ",
"8": "Jorge Santacruz ",
"9": "Matt Core ",
"10": "Manny Singh ",
"11": "Manoj Mishra ",
"12": "Digi Interacts ",
"13": "IHF Ltd. ",
"14": "Hadiur Rahman ",
"15": "The Football Link ",
"16": "BSPL ",
"17": "Votestalk ",
"18": "Codeyiizen "
}
解决方案
您可以按如下方式绑定离子选择选项。您的 JSON 看起来不正确。我给个参考代码
<ion-item>
<ion-label data-target="#filter3">Travel Agencies</ion-label>
<ion-select id="filter3" multiple="true">
<ion-option id="filter3" *ngFor="let travels of filter_type.travels " value="{{travels.id}}">
{{travels.name}}</ion-option>
</ion-select>
</ion-item>
推荐阅读
- pvlib - import pvlib 找不到模块,抛出 [WinError 126]
- reactjs - 时间线素材-ui不占空间
- javascript - 具有外部解析的 Promise.all 永远不会解析
- c# - 为什么我的 LINQ 查询中不包含来自 AspNetUser 的数据?
- scala - 类型稳定参数多态性
- gradient - NetLogo 中的趋化性
- cassandra - Cassandra 如何翻阅墓碑和活细胞?
- sql - PL/SQL Oracle dbms_output 使输出均匀
- python - Matplotlib:散点图和颜色条颜色不匹配
- swift - SwiftUI Textfield 实际上并未对数据进行更新