修改
This commit is contained in:
parent
0f78ff4272
commit
660a0d4c5b
@ -9,10 +9,10 @@
|
|||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
style="display: none"
|
style="display: none"
|
||||||
|
:data="filetype"
|
||||||
ref="upload"
|
ref="upload"
|
||||||
v-if="this.type == 'url'"
|
v-if="this.type == 'url'"
|
||||||
>
|
></el-upload>
|
||||||
</el-upload>
|
|
||||||
<div class="editor" ref="editor" :style="styles"></div>
|
<div class="editor" ref="editor" :style="styles"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -57,10 +57,18 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: "url",
|
default: "url",
|
||||||
},
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: "/common/richTextPictureUrl",
|
||||||
|
},
|
||||||
|
// filetypes: {
|
||||||
|
// type: String,
|
||||||
|
// default: "",
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + "/common/richTextPictureUrl", // 上传的图片服务器地址
|
uploadUrl: process.env.VUE_APP_BASE_API, // 上传的图片服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: "Bearer " + getToken(),
|
||||||
},
|
},
|
||||||
@ -82,14 +90,22 @@ export default {
|
|||||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||||
[{ align: [] }], // 对齐方式
|
[{ align: [] }], // 对齐方式
|
||||||
["clean"], // 清除文本格式
|
["clean"], // 清除文本格式
|
||||||
["link", "image", "video"], // 链接、图片、视频
|
["link", "image"], // 链接、图片、视频
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
placeholder: "请输入内容",
|
placeholder: "请输入内容",
|
||||||
readOnly: this.readOnly,
|
readOnly: this.readOnly,
|
||||||
},
|
},
|
||||||
|
filetype: {
|
||||||
|
type: "",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.uploadUrl = process.env.VUE_APP_BASE_API + this.url;
|
||||||
|
// console.log(this.url)
|
||||||
|
// this.filetype.type = this.filetypes;
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
styles() {
|
styles() {
|
||||||
let style = {};
|
let style = {};
|
||||||
@ -181,9 +197,8 @@ export default {
|
|||||||
"image",
|
"image",
|
||||||
process.env.VUE_APP_BASE_API + res.fileName
|
process.env.VUE_APP_BASE_API + res.fileName
|
||||||
);
|
);
|
||||||
|
console.log(res);
|
||||||
this.$emit("imgs", res.fileName);
|
this.$emit("imgs", res.fileName);
|
||||||
|
|
||||||
// 调整光标到最后
|
// 调整光标到最后
|
||||||
quill.setSelection(length + 1);
|
quill.setSelection(length + 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user