jd-opensource / jd-opensource/nutui
[FR]: Popover 能否增加一个参数,设置弹窗的宽度于目标节点宽度相同?
Open
Feature Request
PR Welcome
- Dominant language
- Vue
- Stars
- 6.5k
- Forks
- 835
- PR merge metrics
- No merged PRs in 30d
Description
### 这个功能解决了什么问题?

希望能和上面input框等宽,这种需求应该是比较常见的
### 你期望的组件设计是怎样的?
// 获取宽度
`
const getContentWidth = () => {
let rect = useRect(popoverRef.value);
if (props.targetId) {
rect = useRect(document.querySelector(`#${props.targetId}`) as Element);
}
rootRect.value = rect;
setTimeout(() => {
conentRootRect.value = {
height: popoverContentRef.value.clientHeight,
width: popoverContentRef.value.clientWidth
};
}, 0);
};
`
新增参数 控制一下 conentRootRect 的宽度是否取rootRect的
Contributor guide
Assessment
This issue has not been assessed yet.