el-dialog组件中
style() {
let style = {
};
if (!this.fullscreen) {
style.marginTop = this.top;
if (this.width) {
style.width = this.width;
}
}
return style;
}
说明style.marginTop = this.top,所以可以直接添加top属性就可以修改margin-top
<el-dialog
title="测试标题"
:visible.sync="DialogVisible"
append-to-body
width="60%"
top="8vh"
>