Uni-App nvue scroll-view 横向滚动 Android 无效 解决方法

错误示例

<scroll-view scroll-y>
    <view v-for="item in list">{{ item.label }}</view>
</scroll-view>

重点在属性 scroll-y,在 H5 甚至 ios 都是没问题的,因为vue标签中只写属性名默认是给 true 值,所以一直没在意这点。没想到在 android 中会有编译差异,必须显性赋值为 true。

正确示例

<scroll-view :scroll-y="true">
    <view v-for="item in list">{{ item.label }}</view>
</scroll-view>

苦了我半天时间,是通过真机运行中的 uni/nvue调试 找到的问题。
2025-05-28T01:11:25.png

标签: Uni-App, nvue

添加新评论