Skip to content

Commit

Permalink
build: release v1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Jul 26, 2020
1 parent 0921c78 commit 2011844
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-md",
"version": "1.3.4",
"version": "1.3.5",
"private": true,
"homepage": "https://doocs.gitee.io/md",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CodemirrorEditor/rightClickMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default {
} else {
this.$emit('menuTick', key)
}
this.$emit('closeMenu',false)
this.$emit('closeMenu', false)
}
},
}
Expand Down
26 changes: 7 additions & 19 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const state = {
currentColor: '',
citeStatus: 0,
nightMode: false,
rightClickMenuVisible:false
rightClickMenuVisible: false
};
const mutations = {
setEditorValue(state, data) {
Expand Down Expand Up @@ -52,7 +52,7 @@ const mutations = {
state.currentColor = data;
localStorage.setItem('color', data)
},
setRightClickMenuVisible(state,data) {
setRightClickMenuVisible(state, data) {
state.rightClickMenuVisible = data;
},
themeChanged(state) {
Expand All @@ -72,8 +72,7 @@ const mutations = {
},
initEditorEntity(state) {
state.editor = CodeMirror.fromTextArea(
document.getElementById('editor'),
{
document.getElementById('editor'), {
value: '',
mode: 'text/x-markdown',
theme: 'xq-light',
Expand All @@ -90,19 +89,13 @@ const mutations = {
}
}
)
// 如果有编辑器内容被保存则读取,否则加载默认内容
if (localStorage.getItem('__editor_content')) {
state.editor.setValue(localStorage.getItem('__editor_content'))
} else {
const doc = formatDoc(DEFAULT_CONTENT)
state.editor.setValue(doc)
}

// 如果有编辑器内容被保存则读取,否则加载默认内容
state.editor.setValue(localStorage.getItem('__editor_content') || formatDoc(DEFAULT_CONTENT))
},
initCssEditorEntity(state) {
state.cssEditor = CodeMirror.fromTextArea(
document.getElementById('cssEditor'),
{
document.getElementById('cssEditor'), {
value: '',
mode: 'css',
theme: 'style-mirror',
Expand All @@ -113,7 +106,6 @@ const mutations = {
extraKeys: {
'Ctrl-F': function autoFormat(editor) {
const totalLines = editor.lineCount()

editor.autoFormatRange({
line: 0,
ch: 0
Expand All @@ -126,11 +118,7 @@ const mutations = {
)

// 如果有编辑器内容被保存则读取,否则加载默认内容
if (localStorage.getItem('__css_content')) {
state.cssEditor.setValue(localStorage.getItem('__css_content'))
} else {
state.cssEditor.setValue(DEFAULT_CSS_CONTENT)
}
state.cssEditor.setValue(localStorage.getItem('__css_content') || DEFAULT_CSS_CONTENT)
},
editorRefresh(state) {
let output = marked(state.editor.getValue(0), {
Expand Down

0 comments on commit 2011844

Please sign in to comment.