vue+iview table表格最多显示10条,超出显示滚动条
时间: 2023-12-22 07:06:31 浏览: 265
你可以在 `<Table>` 标签中设置 `height` 属性为表格的最大高度,例如:
```html
<Table :data="tableData" :height="300">
<Table-column prop="name" label="姓名"></Table-column>
<Table-column prop="age" label="年龄"></Table-column>
<Table-column prop="address" label="地址"></Table-column>
</Table>
```
这样,表格的高度最多为 300px,如果表格的行数超过了 10 条,就会显示纵向滚动条。注意,如果设置了 `height` 属性,表格的 `max-height` 样式也会被设置为相同的值。
另外,如果你想要固定表头,可以设置 `header-fixed` 属性为 `true`:
```html
<Table :data="tableData" :height="300" header-fixed>
<!-- 表头列定义 -->
</Table>
```
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)