zoukankan      html  css  js  c++  java
  • Vue ElementUI 修改MessageBox 弹框样式

    1.情景还原

    <template>
     <el-button type="text" @click="open">点击打开 Message Box</el-button>
    </template>
    
    <script>
     export default {
       methods: {
         open() {
           this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'warning'
           }).then(() => {
             this.$message({
               type: 'success',
               message: '删除成功!'
             });
           }).catch(() => {
             this.$message({
               type: 'info',
               message: '已取消删除'
             });          
           });
         }
       }
     }
    </script>
    
    • 感觉样式太靠下边了~~想要让它往上一些

    那么我们这么改

    2.

     this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
              customClass: 'myClass'
            })
    

    3.附加在没有scoped的style中

    <style>
      .myClass {
         350px;
      }
    </style>
    
  • 相关阅读:
    Java学习心得16
    Java学习心得15
    Java学习心得14
    Java学习心得13
    Java学习心得12
    Java学习心得11
    Java学习心得10
    Java学习心得09
    Java学习心得08
    JVM垃圾回收
  • 原文地址:https://www.cnblogs.com/sugartang/p/13328560.html
Copyright © 2011-2022 走看看