vant tabs标签无法手势滑动,设置swipeable无效

it2026-03-12  2

因为在移动端怎么也滑动不了标签,设置多个属性依然无用 只能去官网一个个对比标签属性 终于找到了这个问题所在,是因为在重置样式文件里设置了touch-action属性,所以滑动无效

* { touch-action: pan-y; }

于是,只要在组件内重新设置就可以了

/deep/.van-tabs__wrap { touch-action: manipulation; }

touch-action属性具体详情参考下方链接: https://developer.mozilla.org/zh-CN/docs/Web/CSS/touch-action

最新回复(0)