md/src/components/CodemirrorEditor/resetDialog.vue

58 lines
1.2 KiB
Vue
Raw Normal View History

2020-05-17 22:19:45 +08:00
<template>
2020-10-20 20:03:36 +08:00
<el-dialog
title="提示"
class="reset__dialog"
:visible="showResetConfirm"
@close="$emit('close')"
>
2020-05-17 22:19:45 +08:00
<div class="text">
此操作将丢失本地缓存的文本和自定义样式是否继续?
</div>
<div slot="footer" class="dialog-footer">
2020-10-20 20:03:36 +08:00
<el-button :type="btnType" plain @click="$emit('close')"
> </el-button
>
<el-button :type="btnType" @click="$emit('confirm')" plain
> </el-button
>
2020-05-17 22:19:45 +08:00
</div>
</el-dialog>
</template>
<script>
2020-10-20 20:03:36 +08:00
import { mapState } from "vuex";
export default {
props: {
showResetConfirm: {
type: Boolean,
default: false,
2020-05-17 22:19:45 +08:00
},
2020-10-20 20:03:36 +08:00
},
computed: {
btnType() {
return this.nightMode ? "default" : "primary";
},
...mapState({
nightMode: (state) => state.nightMode,
}),
},
};
2020-05-17 22:19:45 +08:00
</script>
<style lang="less" scoped>
2020-11-22 20:33:04 +08:00
/deep/ .el-dialog {
min-width: 440px;
}
2020-10-20 20:03:36 +08:00
.reset__dialog {
text-align: center;
}
2020-10-13 00:07:14 +08:00
2020-10-20 20:03:36 +08:00
.text {
text-align: center;
}
2020-10-13 00:07:14 +08:00
2020-10-20 20:03:36 +08:00
.dialog-footer {
text-align: center;
}
2020-10-13 00:07:14 +08:00
</style>