elementUI 的确认弹框时,页面body 右侧缩小15px(padding-right: 15px)的解决方法
文章目录
方法一:app.vue中的style样式里面添加
body{padding-right:0 !important;}
这种方法会使得弹窗也没有缩进。
方法二:重写一个弹框,例如命名为Vmoudel.vue,添加一个body的样式: .body{padding-right:0!important;},接下来挂载使用该组件即可。
<style>
.body{padding-right:0!important;}
<style>
<template>
<el-button type="text" @click="open">点击打开 Message Box</el-button>
</template>
<script>
export default {
methods: {
open() {
this.$alert('这是一段内容', '标题名称', {
confirmButtonText: '确定',
callback: action => {
this.$message({
type: 'info',
message: `action: ${ action }`
});
}
});
}
}
}
</script>
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论