Commit 8c03792c authored by tyyin lan's avatar tyyin lan

fix(首页富文本): 自定义format值丢失问题

parent ddfb409c
...@@ -87,6 +87,13 @@ class TemplateInputPromptBlot extends Embed { ...@@ -87,6 +87,13 @@ class TemplateInputPromptBlot extends Embed {
return root return root
} }
static value(spanEl: HTMLSpanElement) {
return {
placeholder: spanEl.dataset.placeholder,
index: spanEl.dataset.index,
}
}
} }
Quill.register(TemplateInputPromptBlot) Quill.register(TemplateInputPromptBlot)
...@@ -132,16 +132,16 @@ watchEffect(() => { ...@@ -132,16 +132,16 @@ watchEffect(() => {
} }
}) })
quillInst.value.clipboard.addMatcher('span.template-input-prompt-container', (node) => { // quillInst.value.clipboard.addMatcher('span.template-input-prompt-container', (node) => {
const spanEl = node as HTMLSpanElement // const spanEl = node as HTMLSpanElement
return new Delta().insert({ // return new Delta().insert({
'template-input-prompt': { // 'template-input-prompt': {
placeholder: spanEl.dataset.placeholder, // placeholder: spanEl.dataset.placeholder,
index: spanEl.dataset.index, // index: spanEl.dataset.index,
}, // },
}) // })
}) // })
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment