我遵循了最初的插件教程并让图像插入工作,但我想显示一个带有两个输入字段的自定义模式,而不是提示设置更多属性。我将如何最好地实现这一点?
我知道如何在普通的 JS/CSS 中实现一个普通的模态,但是对于在哪里放置 HTML 以在按钮单击时显示模态我有点困惑。
class Test extends Plugin {
init() {
editor = this.editor
editor.ui.componentFactory.add('SampleView', (locale) => {
const view = new ButtonView(locale)
view.set({
label: 'test',
icon: imageIcon,
tooltip: true
})
view.on('execute', () => {
//here I would like to open the modal instead of the prompt
})
})
}
}