el-dialog

作者: asmuzi | 来源:发表于2018-11-21 13:52 被阅读0次
    <template>
      <div>
        <el-dialog :visible.sync="dialogVisibleProp" :title.sync="msg2" width="600px">
          <!-- <span>这是一段信息</span> -->
          <slot></slot>
          <div slot="footer" class="dialog-footer">
            <el-button @click="hide">取 消</el-button>
            <el-button type="primary" @click="hide">确 定</el-button>
          </div>
        </el-dialog>
      </div>
    </template>
    
    <script>
    import "css/achievementAnalysis/unit/dialog.css";
    export default {
      name: "",
      props: {
        msg1: {
          type: Boolean,
          default: false
        },
        msg2: {
          type: String,
          default: ""
        }
      },
      data() {
        return {
          dialogVisible: false,
          dialogTitle: ""
        };
      },
    
      components: {},
    
      computed: {},
    
      beforeMount() {},
    
      mounted() {},
    
      methods: {
        hide() {
          this.$emit("emitParent", false);
          if (this.msg2 == "出错") {
            this.$router.go(-1);
          }
        }
      },
      watch: {},
      computed: {
        dialogVisibleProp: {
          get() {
            return this.msg1;
          },
          set(v) {
            this.$emit("update:msg1", v);
          }
        }
      }
    };
    </script>
    <style lang='' scoped>
    .el-dialog {
      /* min-height:700px;  */
    }
    .dialog-footer {
      text-align: center;
    }
    </style>
    

    相关文章

      网友评论

          本文标题:el-dialog

          本文链接:https://www.haomeiwen.com/subject/kffcqqtx.html