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>
|
<template>
|
||||||
<el-container class="top is-dark">
|
<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'}"
|
:headers="{'Content-Type': 'multipart/form-data'}"
|
||||||
:show-file-list="false" :multiple="true" accept=".jpg,.jpeg,.png,.gif" name="file"
|
:show-file-list="false" :multiple="true" accept=".jpg,.jpeg,.png,.gif" name="file"
|
||||||
:before-upload="beforeUpload">
|
:before-upload="beforeUpload">
|
||||||
<el-tooltip :effect="effect" content="上传图片" placement="bottom-start">
|
<el-tooltip :effect="effect" content="上传图片" placement="bottom-start">
|
||||||
<i class="el-icon-upload" size="medium"></i>
|
<i class="el-icon-upload" size="medium"></i>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-upload>
|
</el-upload> -->
|
||||||
<!-- 下载文本文档 -->
|
<!-- 下载文本文档 -->
|
||||||
<el-tooltip class="header__item" :effect="effect" content="下载编辑框Markdown文档" placement="bottom-start">
|
<el-tooltip class="header__item" :effect="effect" content="下载编辑框Markdown文档" placement="bottom-start">
|
||||||
<i class="el-icon-download" size="medium" @click="$emit('downLoad')"></i>
|
<i class="el-icon-download" size="medium" @click="$emit('downLoad')"></i>
|
||||||
|
@ -33,10 +33,10 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [
|
list: [
|
||||||
{
|
// {
|
||||||
text: '上传图片',
|
// text: '上传图片',
|
||||||
key: 'insertPic'
|
// key: 'insertPic'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
text: '插入表格',
|
text: '插入表格',
|
||||||
key: 'insertTable'
|
key: 'insertTable'
|
||||||
|
@ -123,28 +123,28 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 粘贴上传图片并插入
|
// 粘贴上传图片并插入
|
||||||
this.editor.on('paste', (cm, e) => {
|
// this.editor.on('paste', (cm, e) => {
|
||||||
if (!(e.clipboardData && e.clipboardData.items) || this.isImgLoading) {
|
// if (!(e.clipboardData && e.clipboardData.items) || this.isImgLoading) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
for (let i = 0, len = e.clipboardData.items.length; i < len; ++i) {
|
// for (let i = 0, len = e.clipboardData.items.length; i < len; ++i) {
|
||||||
let item = e.clipboardData.items[i]
|
// let item = e.clipboardData.items[i]
|
||||||
if (item.kind === 'file') {
|
// if (item.kind === 'file') {
|
||||||
this.isImgLoading = true;
|
// this.isImgLoading = true;
|
||||||
const pasteFile = item.getAsFile()
|
// const pasteFile = item.getAsFile()
|
||||||
uploadImgFile(pasteFile).then(res=> {
|
// uploadImgFile(pasteFile).then(res=> {
|
||||||
this.uploaded(res)
|
// this.uploaded(res)
|
||||||
}).catch(err=> {
|
// }).catch(err=> {
|
||||||
this.$message({
|
// this.$message({
|
||||||
showClose: true,
|
// showClose: true,
|
||||||
message: err,
|
// message: err,
|
||||||
type: 'error'
|
// type: 'error'
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
this.isImgLoading = false;
|
// this.isImgLoading = false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
this.editor.on('mousedown', () => {
|
this.editor.on('mousedown', () => {
|
||||||
this.$store.commit('setRightClickMenuVisible', false);
|
this.$store.commit('setRightClickMenuVisible', false);
|
||||||
|
Loading…
Reference in New Issue
Block a user