mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 04:46:44 +08:00
提交修改
This commit is contained in:
@@ -24,6 +24,19 @@ const lineHeightStyle = new lineHeightAttributor("lineHeight", "line-height", {
|
||||
scope: Parchment.Scope.INLINE,
|
||||
whitelist: ["1", "1.5", "2", "3", "4"]
|
||||
});
|
||||
const toolbarOptions = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ size: [false,"18px"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ align: [] }], // 对齐方式
|
||||
[{ lineheight: ['initial', '1', '1.5', '2', '3', '4'] }],
|
||||
["clean"], // 清除文本格式
|
||||
["link", "image"]
|
||||
]
|
||||
Quill.register({ 'formats/lineHeight': lineHeightStyle }, true)
|
||||
export default {
|
||||
name: "Editor",
|
||||
@@ -33,6 +46,10 @@ export default {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
toobar:{
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请输入长度大于100个字符的内容",
|
||||
@@ -68,19 +85,7 @@ export default {
|
||||
},
|
||||
// 工具栏配置
|
||||
toolbar: {
|
||||
container:[
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ size: [false,"18px"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ align: [] }], // 对齐方式
|
||||
[{ lineheight: ['initial', '1', '1.5', '2', '3', '4'] }],
|
||||
["clean"], // 清除文本格式
|
||||
["link", "image"] // 链接、图片、视频, "video"
|
||||
],
|
||||
container:this.toobar? toolbarOptions:[],
|
||||
handlers: {
|
||||
image: function(value) {
|
||||
if (value) {
|
||||
|
||||
Reference in New Issue
Block a user