fix: resolve images issue

This commit is contained in:
yanglbme 2020-07-04 09:41:47 +08:00
parent 90fe9d45b0
commit c8575cd016
2 changed files with 8 additions and 5 deletions

View File

@ -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();
@ -189,6 +189,8 @@ export default {
document.execCommand('copy');
window.getSelection().removeAllRanges()
fixCodeWhiteSpace('normal');
clipboardDiv.innerHTML = this.output;
//
this.$notify({
showClose: true,
@ -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;

View File

@ -16,6 +16,7 @@ Vue.use(Vuex)
const state = {
wxRenderer: null,
output: '',
html: '',
editor: null,
cssEditor: null,
currentFont: '',
@ -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)