uniapp nvue list标签不滚动的问题

这两天一直在跟uniapp打交道,今天发现nvue中的list死活都滚动不了,意外发现了一个小知识,在list标签外层必须得套一层盒子,然后list才会正常滚动,唉,造孽

<template>
  <view> <!-- 在list外层必须套一层盒子,list才会滚动 -->
    <list>
        <!-- 注意事项: 不能使用 index 作为 key 的唯一标识 -->
        <cell v-for="(item, index) in dataList" :key="item.id">
        <text>{{item.name}}</text>
        </cell>
    </list>
  </view>
</template>

<script>
  export default {
    data () {
      return {
        dataList: [{id: "1", name: 'A'}, {id: "2", name: 'B'}, {id: "3", name: 'C'}]
      }
    }
  }
</script>

猜你喜欢

转载自www.cnblogs.com/boystao/p/12980981.html