彈框展示:
代碼:
1 <template> 2 <div> 3 <el-col :span="9" style="text-align: right;"> 4 <el-button @click="dialogVisible=true" 5 style="text-align: right;font-weight:700;font-size: 17px;padding: 7px 10px;">點我彈框 6 </el-button> 7 </el-col> 8 <!--彈框--> 9 <el-dialog title="彈框" :visible.sync="dialogVisible" :close-on-click-modal="true" :modal="true" :show-close="true" :center="true"> 10 內容展示 11 <span slot="footer" class="dialog-footer"> 12 <el-button @click="dialogVisible = false">取 消</el-button> 13 <el-button type="primary" @click="dialogVisible = false">確 定</el-button> 14 </span> 15 </el-dialog> 16 </div> 17 18 </template> 19 <script> 20 export default { 21 data() { 22 return { 23 dialogVisible: false 24 }; 25 }, 26 methods: {} 27 }; 28 </script>
el-dialog 幾個參數:
title:標題名
visible:展示彈框,默認 false
close-on-click-modal:點擊關閉彈框,默認 true
modal:彈框后,后面頁面蒙層,默認 true
show-close:展示關閉按鈕,默認 true
center:頭部和底部居中展示,默認 false