修改选项卡位置调整

master
于肖磊 2025-02-14 18:56:56 +08:00
parent 3bf0818904
commit 7796cea1da
1 changed files with 4 additions and 2 deletions

View File

@ -322,7 +322,6 @@
tabs_adorn_img_style: this.get_tabs_adorn_img_style(new_style),
tabs_adorn_icon_size: (new_style?.tabs_adorn_icon_size || 0) * 2 + 'rpx',
});
console.log(this.tabs_padding_bottom);
// dom
// if (['center', 'right'].includes(this.form.justification)) {
setTimeout(() => {
@ -399,11 +398,14 @@
const query = uni.createSelectorQuery().in(this);
query.selectAll(`.scroll-item-` + this.propKey)
.boundingClientRect((rect) => {
const tabs_index = this.form.tabs_list.findIndex(item => item.is_sliding_fixed == '1');
// left left
const new_width = tabs_index == 0 ? rect[1].left - rect[0].width - rect[0].left : rect[0].left;
const scrollLeft =
rect[index].left +
rect[index].width / 2 -
this.tabs_width / 2 -
rect[0].left;
new_width
this.setData({
scroll_left: scrollLeft,
});