设置items-source和display-member-path。
代码参考:
- <wj-combo-box
- items-source="products"
- display-member-path="name">
- </wj-combo-box>
复制代码- //数据源
- var products = [
- { name: 'Widget', price: 123, category: 1 },
- { name: 'Gadget', price: 456, category: 2 },
- { name: 'Sprocket', price: 32, category: -1 }, // no category
- { name: 'Gizmo', price: 56, category: 2 },
- { name: 'Doohickey', price: 31, category: 1 }
- ];
复制代码 |