mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
parent
449617fd23
commit
bc4a629222
@ -31,11 +31,11 @@
|
||||
>
|
||||
<i class="el-icon-document" size="medium" @click="$emit('export')"></i>
|
||||
</el-tooltip>
|
||||
<!-- 页面重置 -->
|
||||
<!-- 样式重置 -->
|
||||
<el-tooltip
|
||||
class="header__item"
|
||||
:effect="effect"
|
||||
content="重置页面"
|
||||
content="重置样式"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<i
|
||||
@ -316,11 +316,10 @@ export default {
|
||||
this.setCssEditorValue(DEFAULT_CSS_CONTENT);
|
||||
}
|
||||
},
|
||||
// 重置页面
|
||||
// 重置样式
|
||||
confirmReset() {
|
||||
localStorage.clear();
|
||||
this.clearEditorToDefault();
|
||||
this.editor.focus();
|
||||
this.cssEditor.setValue(DEFAULT_CSS_CONTENT);
|
||||
this.citeStatus = false;
|
||||
this.statusChanged(false);
|
||||
this.fontChanged(this.config.builtinFonts[0].value);
|
||||
@ -337,7 +336,6 @@ export default {
|
||||
this.editor.focus();
|
||||
},
|
||||
...mapMutations([
|
||||
"clearEditorToDefault",
|
||||
"setCurrentColor",
|
||||
"setCiteStatus",
|
||||
"themeChanged",
|
||||
|
@ -5,7 +5,7 @@
|
||||
:visible="showResetConfirm"
|
||||
@close="$emit('close')"
|
||||
>
|
||||
<div class="text">此操作将丢失本地缓存的文本和自定义样式,是否继续?</div>
|
||||
<div class="text">此操作将丢失本地自定义样式,是否继续?</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :type="btnType" plain @click="$emit('close')">取 消</el-button>
|
||||
<el-button :type="btnType" @click="$emit('confirm')" plain
|
||||
|
@ -47,8 +47,8 @@ export default {
|
||||
key: "insertTable",
|
||||
},
|
||||
{
|
||||
text: "页面重置",
|
||||
key: "pageReset",
|
||||
text: "恢复默认样式",
|
||||
key: "resetStyle",
|
||||
},
|
||||
],
|
||||
[
|
||||
|
@ -392,7 +392,7 @@ export default {
|
||||
},
|
||||
onMenuEvent(type, info = {}) {
|
||||
switch (type) {
|
||||
case "pageReset":
|
||||
case "resetStyle":
|
||||
this.$refs.header.showResetConfirm = true;
|
||||
break;
|
||||
case "insertPic":
|
||||
|
@ -154,12 +154,6 @@ const mutations = {
|
||||
}
|
||||
state.output = output;
|
||||
},
|
||||
clearEditorToDefault(state) {
|
||||
const doc = formatDoc(DEFAULT_CONTENT);
|
||||
|
||||
state.editor.setValue(doc);
|
||||
state.cssEditor.setValue(DEFAULT_CSS_CONTENT);
|
||||
},
|
||||
};
|
||||
|
||||
export default new Vuex.Store({
|
||||
|
Loading…
Reference in New Issue
Block a user