mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
refactor: temporarily remove images uploading feature
This commit is contained in:
parent
a5a254c0d1
commit
563c3855a6
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<el-container class="top is-dark">
|
||||
<!-- 图片上传 -->
|
||||
<el-upload class="header__item" action="https://imgkr.com/api/files/upload"
|
||||
<!-- <el-upload class="header__item" action="https://imgkr.com/api/files/upload"
|
||||
:headers="{'Content-Type': 'multipart/form-data'}"
|
||||
:show-file-list="false" :multiple="true" accept=".jpg,.jpeg,.png,.gif" name="file"
|
||||
:before-upload="beforeUpload">
|
||||
<el-tooltip :effect="effect" content="上传图片" placement="bottom-start">
|
||||
<i class="el-icon-upload" size="medium"></i>
|
||||
</el-tooltip>
|
||||
</el-upload>
|
||||
</el-upload> -->
|
||||
<!-- 下载文本文档 -->
|
||||
<el-tooltip class="header__item" :effect="effect" content="下载编辑框Markdown文档" placement="bottom-start">
|
||||
<i class="el-icon-download" size="medium" @click="$emit('downLoad')"></i>
|
||||
|
@ -33,10 +33,10 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
text: '上传图片',
|
||||
key: 'insertPic'
|
||||
},
|
||||
// {
|
||||
// text: '上传图片',
|
||||
// key: 'insertPic'
|
||||
// },
|
||||
{
|
||||
text: '插入表格',
|
||||
key: 'insertTable'
|
||||
|
@ -123,28 +123,28 @@ export default {
|
||||
});
|
||||
|
||||
// 粘贴上传图片并插入
|
||||
this.editor.on('paste', (cm, e) => {
|
||||
if (!(e.clipboardData && e.clipboardData.items) || this.isImgLoading) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0, len = e.clipboardData.items.length; i < len; ++i) {
|
||||
let item = e.clipboardData.items[i]
|
||||
if (item.kind === 'file') {
|
||||
this.isImgLoading = true;
|
||||
const pasteFile = item.getAsFile()
|
||||
uploadImgFile(pasteFile).then(res=> {
|
||||
this.uploaded(res)
|
||||
}).catch(err=> {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: err,
|
||||
type: 'error'
|
||||
});
|
||||
});
|
||||
this.isImgLoading = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
// this.editor.on('paste', (cm, e) => {
|
||||
// if (!(e.clipboardData && e.clipboardData.items) || this.isImgLoading) {
|
||||
// return;
|
||||
// }
|
||||
// for (let i = 0, len = e.clipboardData.items.length; i < len; ++i) {
|
||||
// let item = e.clipboardData.items[i]
|
||||
// if (item.kind === 'file') {
|
||||
// this.isImgLoading = true;
|
||||
// const pasteFile = item.getAsFile()
|
||||
// uploadImgFile(pasteFile).then(res=> {
|
||||
// this.uploaded(res)
|
||||
// }).catch(err=> {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// message: err,
|
||||
// type: 'error'
|
||||
// });
|
||||
// });
|
||||
// this.isImgLoading = false;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
this.editor.on('mousedown', () => {
|
||||
this.$store.commit('setRightClickMenuVisible', false);
|
||||
|
Loading…
Reference in New Issue
Block a user