Closed easylogic closed 3 years ago
모듈 하나에 거대한 공용의 자료 공유 형태가 필요한데.
외부 주입 모듈 만들기
export default {
command: 'setAttribute',
title: 'Set Attribute for Item',
description: '',
execute (editor, a, b, c ) {
editor.emit('refresh', a, b, c);
}
}
// shortcuts
export default [
{ key: 'cmd+m', command: `setAttribute`},
{ key: 'cmd+m', command: `setAttribute`},
{ key: 'cmd+m', command: `setAttribute`},
{ key: 'cmd+m', command: `setAttribute`},
{ key: 'cmd+m', command: `setAttribute`},
]
editor.commands.registerCommand('name', command.execute)
editor.components.registerComponent('name', CubeLayer);
editor.shortcuts.registerShortcut({
key: 'cmd+m',
when: 'textInputFocus', // 상태 정의가 필요하군요. vscode 를 참고해봅시다.
command : `command's name`
});
이걸 사전에 정의할려면 render 시점을 뒤로 할 수 있도록 해야겠군.
이건 안하는걸로 하자.
에디터를 하나의 단위로 만들지 않으면 인터랙션을 제어하기도 힘들고
store 를 제어하기도 힘들다.
그냥 화면 하나 단위로 하자.
에디터 자체를 모듈로서 임베드 할 수 있도록 한다.