amis
amis copied to clipboard
table-view的单元格, 数据源必须是一个组件
当 table-view 的单元格是一个列表时,
{"tds": [{
"body": [
{
"type": "list",
"source": "${viewData.options.includes|strToListArray}",
"listItem": {
"subTitle": "$desc"
},
},
]
}]}
渲染的时候会遇到报错(不过渲染可以成功)
[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[ListRenderer.render()]' Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
测试后估计是 source 的数据源对非显示组件的支持有问题, 可能内部觉得没法监听到状态?
暂时使用辅助组件解决
{"tds": [{
"body": [
{
"type": "input-text",
"value": "${viewData.options.includes|strToListArray}",
"name": "tmpTpl",
"visible": false,
},
{
"type": "list",
"source": "$tmpTpl",
"listItem": {
"subTitle": "$desc"
},
},
]
}]}
ps: 目前好些问题貌似都只能使用辅助组件解决