|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="quill" :class="classes"> |
|
|
|
<div class="quill" ref="quill" :class="classes"> |
|
|
|
<div ref="editor" :style="styles" v-loading="loading"></div> |
|
|
|
<div ref="editor" :style="styles" v-loading="loading"></div> |
|
|
|
|
|
|
|
|
|
|
|
<el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" style="display: none"> |
|
|
|
<el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" style="display: none"> |
|
|
@ -40,6 +40,10 @@ |
|
|
|
minHeight: { |
|
|
|
minHeight: { |
|
|
|
type: Number |
|
|
|
type: Number |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* 原本的readOnly失效,对比其他项目,发现是quill版本不同导致, |
|
|
|
|
|
|
|
* 使用props传入elseRead = 'true',手动隐藏工具栏 |
|
|
|
|
|
|
|
*/ |
|
|
|
elseRead:{ |
|
|
|
elseRead:{ |
|
|
|
type:String,default:'false' |
|
|
|
type:String,default:'false' |
|
|
|
} |
|
|
|
} |
|
|
@ -107,13 +111,17 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
created(){ |
|
|
|
console.log(this.elseRead,'elseRead'); |
|
|
|
|
|
|
|
console.log(this.readonly,'readonly'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.value,'value'); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
this.init(); |
|
|
|
this.init(); |
|
|
|
|
|
|
|
// 处理工具栏隐藏样式 |
|
|
|
|
|
|
|
if(this.elseRead==='true'){ |
|
|
|
|
|
|
|
let children = this.$refs.quill.children[0].style |
|
|
|
|
|
|
|
children.padding = '0' |
|
|
|
|
|
|
|
children.overflow = 'hidden' |
|
|
|
|
|
|
|
children.height = '0' |
|
|
|
|
|
|
|
children.borderTop = '0' |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeDestroy () { |
|
|
|
beforeDestroy () { |
|
|
|
// 在组件销毁后销毁实例 |
|
|
|
// 在组件销毁后销毁实例 |
|
|
@ -186,4 +194,13 @@ |
|
|
|
border: none; |
|
|
|
border: none; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.else{ |
|
|
|
|
|
|
|
.ql-toolbar.ql-snow{ |
|
|
|
|
|
|
|
height: 0; |
|
|
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
padding: 0; |
|
|
|
|
|
|
|
border-top: 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |
|
|
|