chore(frontend): 落地 ADS 治理体系并收录前端底座基线代码
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { h } from 'vue'
|
||||
|
||||
export function useRenderHeader(node: any) {
|
||||
const { column } = node
|
||||
let realWidth = 0;
|
||||
let span = document.createElement('span');
|
||||
span.innerText = column.label;
|
||||
document.body.appendChild(span);
|
||||
realWidth = span.getBoundingClientRect().width;
|
||||
column.minWidth = realWidth+16; // 可能还有边距/边框等值,需要根据实际情况加上
|
||||
document.body.removeChild(span);
|
||||
|
||||
return h('span', column.label)
|
||||
}
|
||||
Reference in New Issue
Block a user