Skip to content

Commit 2011844

Browse files
committed
build: release v1.3.5
1 parent 0921c78 commit 2011844

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-md",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44
"private": true,
55
"homepage": "https://doocs.gitee.io/md",
66
"scripts": {

src/components/CodemirrorEditor/rightClickMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676
} else {
7777
this.$emit('menuTick', key)
7878
}
79-
this.$emit('closeMenu',false)
79+
this.$emit('closeMenu', false)
8080
}
8181
},
8282
}

src/store/index.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const state = {
2424
currentColor: '',
2525
citeStatus: 0,
2626
nightMode: false,
27-
rightClickMenuVisible:false
27+
rightClickMenuVisible: false
2828
};
2929
const mutations = {
3030
setEditorValue(state, data) {
@@ -52,7 +52,7 @@ const mutations = {
5252
state.currentColor = data;
5353
localStorage.setItem('color', data)
5454
},
55-
setRightClickMenuVisible(state,data) {
55+
setRightClickMenuVisible(state, data) {
5656
state.rightClickMenuVisible = data;
5757
},
5858
themeChanged(state) {
@@ -72,8 +72,7 @@ const mutations = {
7272
},
7373
initEditorEntity(state) {
7474
state.editor = CodeMirror.fromTextArea(
75-
document.getElementById('editor'),
76-
{
75+
document.getElementById('editor'), {
7776
value: '',
7877
mode: 'text/x-markdown',
7978
theme: 'xq-light',
@@ -90,19 +89,13 @@ const mutations = {
9089
}
9190
}
9291
)
93-
// 如果有编辑器内容被保存则读取,否则加载默认内容
94-
if (localStorage.getItem('__editor_content')) {
95-
state.editor.setValue(localStorage.getItem('__editor_content'))
96-
} else {
97-
const doc = formatDoc(DEFAULT_CONTENT)
98-
state.editor.setValue(doc)
99-
}
10092

93+
// 如果有编辑器内容被保存则读取,否则加载默认内容
94+
state.editor.setValue(localStorage.getItem('__editor_content') || formatDoc(DEFAULT_CONTENT))
10195
},
10296
initCssEditorEntity(state) {
10397
state.cssEditor = CodeMirror.fromTextArea(
104-
document.getElementById('cssEditor'),
105-
{
98+
document.getElementById('cssEditor'), {
10699
value: '',
107100
mode: 'css',
108101
theme: 'style-mirror',
@@ -113,7 +106,6 @@ const mutations = {
113106
extraKeys: {
114107
'Ctrl-F': function autoFormat(editor) {
115108
const totalLines = editor.lineCount()
116-
117109
editor.autoFormatRange({
118110
line: 0,
119111
ch: 0
@@ -126,11 +118,7 @@ const mutations = {
126118
)
127119

128120
// 如果有编辑器内容被保存则读取,否则加载默认内容
129-
if (localStorage.getItem('__css_content')) {
130-
state.cssEditor.setValue(localStorage.getItem('__css_content'))
131-
} else {
132-
state.cssEditor.setValue(DEFAULT_CSS_CONTENT)
133-
}
121+
state.cssEditor.setValue(localStorage.getItem('__css_content') || DEFAULT_CSS_CONTENT)
134122
},
135123
editorRefresh(state) {
136124
let output = marked(state.editor.getValue(0), {

0 commit comments

Comments
 (0)