fix(components): [segmented] fix label item width render (#21379)

* fix(components): [segmented]  fix label item width render

* Update segmented.vue

* chore: use zhiaxiaotong solution

* Update segmented.vue

* chore: foramt

Co-authored-by: zhixiaotong <947803089@qq.com>

---------

Co-authored-by: 知晓同丶 <zhixiaotong.me@qq.com>
This commit is contained in:
Jeff
2025-07-17 23:45:54 +08:00
committed by GitHub
parent da08a2ffaf
commit 80157249ef

View File

@ -130,13 +130,12 @@ const updateSelect = () => {
state.focusVisible = false
return
}
const rect = selectedItem.getBoundingClientRect()
state.isInit = true
if (props.direction === 'vertical') {
state.height = rect.height
state.height = selectedItem.offsetHeight
state.translateY = selectedItem.offsetTop
} else {
state.width = rect.width
state.width = selectedItem.offsetWidth
state.translateX = selectedItem.offsetLeft
}
try {