mirror of
https://github.com/doocs/md.git
synced 2024-11-25 03:18:36 +08:00
Merge branch 'master' of github.com:doocs/md into feature-bug-fix
This commit is contained in:
commit
fc6d5e1d00
@ -18,6 +18,7 @@
|
|||||||
Markdown 文档自动即时渲染为微信图文,让你不再为微信文章排版而发愁!只要你会基本的 Markdown 语法,就能做出一篇样式简洁而又美观大方的微信图文。
|
Markdown 文档自动即时渲染为微信图文,让你不再为微信文章排版而发愁!只要你会基本的 Markdown 语法,就能做出一篇样式简洁而又美观大方的微信图文。
|
||||||
|
|
||||||
## 在线编辑器地址
|
## 在线编辑器地址
|
||||||
|
|
||||||
- Gitee Pages:https://doocs.gitee.io/md
|
- Gitee Pages:https://doocs.gitee.io/md
|
||||||
- GitHub Pages:https://doocs.github.io/md
|
- GitHub Pages:https://doocs.github.io/md
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-md",
|
"name": "vue-md",
|
||||||
"version": "1.3.2",
|
"version": "1.3.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://doocs.gitee.io/md",
|
"homepage": "https://doocs.gitee.io/md",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
<el-tooltip class="item" :effect="effect" content="自定义CSS样式" placement="left">
|
<el-tooltip class="item" :effect="effect" content="自定义CSS样式" placement="left">
|
||||||
<el-button :type="btnType" plain size="medium" icon="el-icon-setting" @click="customStyle"></el-button>
|
<el-button :type="btnType" plain size="medium" icon="el-icon-setting" @click="customStyle"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button :type="btnType" plain size="medium" @click="copy">复制</el-button>
|
<el-button :type="btnType" plain size="medium" @click="copy" placement="bottom-start">复制</el-button>
|
||||||
<el-button :type="btnType" plain size="medium" class="about" @click="$emit('showAboutDialog')">关于</el-button>
|
<el-button :type="btnType" plain size="medium" class="about" @click="$emit('showAboutDialog')">关于</el-button>
|
||||||
<el-tooltip content="夜间模式" placement="bottom-start">
|
<el-tooltip content="夜间模式" placement="bottom-start">
|
||||||
<div class="mode__switch" v-if="!nightMode" @click="themeChanged"></div>
|
<div class="mode__switch" v-if="!nightMode" @click="themeChanged"></div>
|
||||||
@ -171,13 +171,13 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
// 复制到微信公众号
|
// 复制到微信公众号
|
||||||
copy() {
|
copy(e) {
|
||||||
this.$emit('startCopy');
|
this.$emit('startCopy');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
let clipboardDiv = document.getElementById('output');
|
||||||
solveWeChatImage();
|
solveWeChatImage();
|
||||||
fixCodeWhiteSpace();
|
fixCodeWhiteSpace();
|
||||||
this.setOutput(solveHtml());
|
this.setHtml(solveHtml());
|
||||||
let clipboardDiv = document.getElementById('output');
|
|
||||||
|
|
||||||
clipboardDiv.focus();
|
clipboardDiv.focus();
|
||||||
window.getSelection().removeAllRanges();
|
window.getSelection().removeAllRanges();
|
||||||
@ -187,9 +187,10 @@ export default {
|
|||||||
range.setEndAfter(clipboardDiv.lastChild);
|
range.setEndAfter(clipboardDiv.lastChild);
|
||||||
window.getSelection().addRange(range);
|
window.getSelection().addRange(range);
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
range.setStartBefore(clipboardDiv.firstChild);
|
window.getSelection().removeAllRanges()
|
||||||
range.setEndAfter(clipboardDiv.firstChild);
|
|
||||||
fixCodeWhiteSpace('normal');
|
fixCodeWhiteSpace('normal');
|
||||||
|
|
||||||
|
clipboardDiv.innerHTML = this.output;
|
||||||
// 输出提示
|
// 输出提示
|
||||||
this.$notify({
|
this.$notify({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
@ -201,6 +202,7 @@ export default {
|
|||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
this.$emit('endCopy');
|
this.$emit('endCopy');
|
||||||
}, 350);
|
}, 350);
|
||||||
|
e.target.blur();
|
||||||
},
|
},
|
||||||
// 自定义CSS样式
|
// 自定义CSS样式
|
||||||
async customStyle () {
|
async customStyle () {
|
||||||
|
@ -16,6 +16,7 @@ Vue.use(Vuex)
|
|||||||
const state = {
|
const state = {
|
||||||
wxRenderer: null,
|
wxRenderer: null,
|
||||||
output: '',
|
output: '',
|
||||||
|
html: '',
|
||||||
editor: null,
|
editor: null,
|
||||||
cssEditor: null,
|
cssEditor: null,
|
||||||
currentFont: '',
|
currentFont: '',
|
||||||
@ -25,8 +26,8 @@ const state = {
|
|||||||
nightMode: false
|
nightMode: false
|
||||||
};
|
};
|
||||||
const mutations = {
|
const mutations = {
|
||||||
setOutput(state, data) {
|
setHtmL(state, data) {
|
||||||
state.output = data;
|
state.html = data;
|
||||||
},
|
},
|
||||||
setEditorValue(state, data) {
|
setEditorValue(state, data) {
|
||||||
state.editor.setValue(data)
|
state.editor.setValue(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user