mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
chore: 调整 table 宽度同步预览整个表格而不是只预览第一行
This commit is contained in:
parent
3c87ba1e8b
commit
735bd28f2a
@ -966,7 +966,7 @@ export const TableStore = iRendererStore
|
||||
}
|
||||
const tableWidth = table.parentElement!.offsetWidth;
|
||||
const thead = table.querySelector(':scope>thead')!;
|
||||
const tbodyTr = table.querySelector(':scope>tbody>tr:first-child');
|
||||
const tbody = table.querySelector(':scope>tbody');
|
||||
const div = document.createElement('div');
|
||||
div.className = 'amis-scope'; // jssdk 里面 css 会在这一层
|
||||
div.style.cssText += `visibility: hidden!important;`;
|
||||
@ -976,7 +976,7 @@ export const TableStore = iRendererStore
|
||||
'is-layout-fixed',
|
||||
''
|
||||
)}">${thead.outerHTML}${
|
||||
tbodyTr ? `<tbody>${tbodyTr.outerHTML}</tbody>` : ''
|
||||
tbody ? `<tbody>${tbody.innerHTML}</tbody>` : ''
|
||||
}</table>`;
|
||||
const ths1: Array<HTMLTableCellElement> = [].slice.call(
|
||||
div.querySelectorAll(':scope>table:first-child>thead>tr>th[data-index]')
|
||||
|
Loading…
Reference in New Issue
Block a user