nutui
nutui copied to clipboard
[FR]: Popover 能否增加一个参数,设置弹窗的宽度于目标节点宽度相同?
这个功能解决了什么问题?
希望能和上面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的