나는 quill.js로 그립을 얻고 있습니다. 미리 설정된 내용으로 사용자 정의 오 점을 만들 수는 있지만 변경할 수 있습니다. 중간 복제본 가이드에서 블롯 내장 블롯을 만드는 방법을 알아 냈지만 생성 된 노드가 델타 내용으로 캡처되지 않는다는 것을 알아 냈습니다. 스타일이 지정된 div 안에 텍스트를 몇 개 설정 했으므로 저장하고 싶습니다. 변경 ... 동적 캡션과 같은 작업에도이 프로세스를 사용하고 싶습니다 ... 델타를 저장할 수있는 것이 중요합니다. node.innerText = '테스트 테스트 테스트'는 초기 내용을 잘 설정하지만 변경 사항은 델타에 바인딩되지 않습니다.Quill.js 확장 블롯/양피지 변경 내용이 델타에서 캡처되지 않음
블롯을 블록 내에 중첩시키는 방법이 있습니까? 또는 어떻게 든 델타로 오점 내용을 바인딩 할 수 있습니까? 도움이되는 예제 코드는 대단히 감사하겠습니다. 고맙습니다.
class EditModuleBlot extends BlockEmbed {
static create(value) {
let node = super.create();
node.setAttribute('style', value.style);
node.innerText = 'test test test';
return node;
}
static value(node) {
return {
style: node.getAttribute('style')
};
}
}
EditModuleBlot.blotName = 'editmodule';
EditModuleBlot.tagName = 'div';
이 그것을 호출 내 Vue.js 방법입니다 :
{
"insert": {
"editmodule": {
"style": "padding:10px;border: 2px dashed black;"
}
}
},
* 갱신 * 돈 :
clickAddModule() {
let range = this.quillInstance.getSelection(true);
this.quillInstance.insertText(range.index, '\n', Quill.sources.USER);
this.quillInstance.insertEmbed(range.index + 1, 'editmodule', {
style: 'padding:10px;border: 2px dashed black;'
}, Quill.sources.USER);
this.quillInstance.setSelection(range.index + 2, Quill.sources.SILENT);
}
델타 JSON은 DIV의 innerText와 캡처하지 않습니다 블록 확장을 위해 quill을 사용하지 않는다. 제대로 처리하지 못한다. Slate.js 나 Prose Mirror 또는 CkEditor를 사용한다.