Closed iyangxuqing closed 2 years ago
let html = <table><tr><td>123</td></tr><tr><td>456</td></tr></table> let obj = app.towxml(html, 'html', { events:{ tap:e => { // console.log('tap',e); }, change:e => { // console.log('todo',e); } } }); this.setData({ article: obj, });
<table><tr><td>123</td></tr><tr><td>456</td></tr></table>
渲染结果是这样的:
表格中的内容123、456没有被渲染出来
看来是要加入tbody标签 let html = “<table><tbody><tr><td>123</td></tr><tr><td>456</td></tr></tbody></table>” 这样就可以了
“<table><tbody><tr><td>123</td></tr><tr><td>456</td></tr></tbody></table>”
let html =
<table><tr><td>123</td></tr><tr><td>456</td></tr></table>
let obj = app.towxml(html, 'html', { events:{ tap:e => { // console.log('tap',e); }, change:e => { // console.log('todo',e); } } }); this.setData({ article: obj, });渲染结果是这样的:![捕获](https://user-images.githubusercontent.com/8756465/185772811-8a7c3c78-0635-41a6-987a-f054fcb5a14f.PNG)