Код: Выделить всё
customElements.define("test-editor", class extends HTMLElement {
constructor() {
super();
const editorContainer = document.createElement("div");
editorContainer.setAttribute("id", "editor_container");
const root = this.attachShadow({mode: "open"});
root.appendChild(editorContainer);
}
connectedCallback() {
ace.edit("editor_container");
}
});
Код: Выделить всё
html, body, #editor_container {
width: 100%;
height: 100%;
}
Неперехваченная ошибка: ace.edit не может найти div #editor_container
в Object.t.edit (ace.js:1)
в HTMLElement.connectedCallback (custom_element.js:17)
на custom_element.js:3
Можно ли как-нибудь встроить экземпляр Ace Editor в пользовательский элемент?
Подробнее здесь: https://stackoverflow.com/questions/633 ... ace-editor
Мобильная версия