Skip to content

Commit

Permalink
fix: resolve images issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Jul 4, 2020
1 parent 90fe9d4 commit c8575cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/components/codeMirror/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ export default {
copy(e) {
this.$emit('startCopy');
setTimeout(() => {
let clipboardDiv = document.getElementById('output');
solveWeChatImage();
fixCodeWhiteSpace();
this.setOutput(solveHtml());
let clipboardDiv = document.getElementById('output');
this.setHtml(solveHtml());
clipboardDiv.focus();
window.getSelection().removeAllRanges();
Expand All @@ -189,6 +189,8 @@ export default {
document.execCommand('copy');
window.getSelection().removeAllRanges()
fixCodeWhiteSpace('normal');
clipboardDiv.innerHTML = this.output;
// 输出提示
this.$notify({
showClose: true,
Expand Down Expand Up @@ -251,7 +253,7 @@ export default {
document.body.removeChild(downLink)
},
...mapMutations(['clearEditorToDefault','setCurrentColor', 'setCiteStatus', 'themeChanged',
'setOutput', 'setCurrentFont', 'setCurrentSize', 'setCssEditorValue', 'setWxRendererOptions'])
'setHtml', 'setCurrentFont', 'setCurrentSize', 'setCssEditorValue', 'setWxRendererOptions'])
},
mounted() {
this.selectFont = this.currentFont;
Expand Down
5 changes: 3 additions & 2 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Vue.use(Vuex)
const state = {
wxRenderer: null,
output: '',
html: '',
editor: null,
cssEditor: null,
currentFont: '',
Expand All @@ -25,8 +26,8 @@ const state = {
nightMode: false
};
const mutations = {
setOutput(state, data) {
state.output = data;
setHtmL(state, data) {
state.html = data;
},
setEditorValue(state, data) {
state.editor.setValue(data)
Expand Down

0 comments on commit c8575cd

Please sign in to comment.