el-dialog
2018-11-21 本文已影响0人
asmuzi
<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>