让fixe和absolute根据锚点元素定位
作用
让fixe和absolute根据锚点元素去定位
使用方式
父元素
anchor-name: --health-selected;
子元素
const supportAnchor = 'position-anchor' in document.createElement('div').style;const table = document.querySelector('.health-select-all-table') as unknown as HTMLElement;const target = document.querySelector('.health-table-select-all-checkbox');if (isTreeData || !target || !supportAnchor) return;target.parentElement.style.cssText += `border-top: 1px solid rgba(0, 0, 0, 0.1);position: fixed;position-anchor: --health-selected;bottom: anchor(bottom);left: anchor(left);right: anchor(right);background: #fff;`;table.style.paddingBottom = `${target.parentElement.getBoundingClientRect().height}px`;