弹框展示:

vue 弹框-LMLPHP

代码:

 <template>
<div>
<el-col :span="9" style="text-align: right;">
<el-button @click="dialogVisible=true"
style="text-align: right;font-weight:700;font-size: 17px;padding: 7px 10px;">点我弹框
</el-button>
</el-col>
<!--弹框-->
<el-dialog title="弹框" :visible.sync="dialogVisible" :close-on-click-modal="true" :modal="true" :show-close="true" :center="true">
内容展示
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</div> </template>
<script>
export default {
data() {
return {
dialogVisible: false
};
},
methods: {}
};
</script>
el-dialog 几个参数:
title:标题名
visible:展示弹框,默认 false
close-on-click-modal:点击关闭弹框,默认 true
modal:弹框后,后面页面蒙层,默认 true
show-close:展示关闭按钮,默认 true
center:头部和底部居中展示,默认 false
05-23 04:07