代码实现:
- // 要绑定的数据
- const persons = [
- { name: 'Peter', age: 16 },
- { name: 'Mark', age: 18 },
- { name: 'John', age: 27 },
- { name: 'Jane', age: 14 },
- ]
- // 列信息
- const colInfos = [
- { name: 'name', displayName: 'A' },
- { name: 'age', displayName: 'B' },
- ]
- sheet.autoGenerateColumns = false
- sheet.setDataSource(persons)
- sheet.bindColumns(colInfos)
复制代码
|