vue的message提示信息修改提示框所在页面位置高度,可以使用message的offset属性通过数值来改变提示框位置!
html部分代码
javascript
<div>
<el-button type="primary" @click="showMessage" style="margin-left:40%;margin-top:1%">触发提示信息</el-button>
</div>
js部分代码
javascript
showMessage(){
// 使用message的offset属性去设置高度
this.$message({
type:'warning',
message:'使用offset可更改提示信息位置高度哟!',
offset:0
})
}
当offset为0时我们可以看到提示框的位置在按钮上方!

当offset值被我们修改为200后,可以看到提示框位置就在按钮下方了!
