vue滑动页面时固定el-row
时间: 2023-02-13 10:27:30 浏览: 121
你可以使用 `position: fixed` 来固定 `el-row`。
首先,你需要在你的 CSS 中给 `el-row` 添加 `position: fixed` 属性。然后,你可以使用 `top` 和 `left` 属性来控制 `el-row` 的位置。
例如,如果你想要将 `el-row` 固定在页面顶部,你可以这样写:
```css
.el-row {
position: fixed;
top: 0;
left: 0;
}
```
如果你想要更精确地控制 `el-row` 的位置,你可以使用 `right` 和 `bottom` 属性。
例如,如果你想要将 `el-row` 固定在页面底部,你可以这样写:
```css
.el-row {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
```
希望这能帮到你!
相关问题
vue el-row鼠标滑动页面时位置不变
在 Vue 中使用 el-row 时,如果鼠标滑动页面时 el-row 的位置不变,可能是因为您的 el-row 设置了固定定位(position: fixed)。您可以尝试将 el-row 的 position 设置为 absolute 或 relative,或者去掉 position 的设置。
vue el-row固定
如果要在 el-row 中使用固定布局,可以在 el-row 上使用 fixed 属性。
例如:
```
<el-row :gutter="20" fixed>
<el-col :span="12">
左边的列
</el-col>
<el-col :span="12">
右边的列
</el-col>
</el-row>
```
这样 el-row 就会使用固定布局,左右两列的宽度也就固定了。
另外,如果想要让 el-row 的高度也固定,可以在 el-row 上使用 height 属性。例如:
```
<el-row :gutter="20" fixed height="100px">
<el-col :span="12">
左边的列
</el-col>
<el-col :span="12">
右边的列
</el-col>
</el-row>
```
这样 el-row 的高度就会固定在 100px。