初始化
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
import { ButtonConfig } from '../../../index.type';
|
||||
import type { ButtonConfig } from '../../../index.type';
|
||||
import type { BimEngine } from '../../../../../bim-engine';
|
||||
import { infoIcon } from './icon';
|
||||
|
||||
export const infoButton: ButtonConfig = {
|
||||
id: 'toolbar-info',
|
||||
type: 'button',
|
||||
label: 'toolbar.info',
|
||||
icon: infoIcon,
|
||||
onClick: () => {
|
||||
// WORKAROUND: Dispatch a standard custom event on document
|
||||
document.dispatchEvent(new CustomEvent('bim-demo:open-property-panel'));
|
||||
}
|
||||
/**
|
||||
* 信息按钮配置
|
||||
* 说明:当前仍保留 demo 的事件触发方式;engine 已注入,便于未来替换为 SDK 内部逻辑。
|
||||
*/
|
||||
export const createInfoButton = (_engine: BimEngine): ButtonConfig => {
|
||||
return {
|
||||
id: 'toolbar-info',
|
||||
groupId: 'group-2',
|
||||
type: 'button',
|
||||
label: 'toolbar.info',
|
||||
icon: infoIcon,
|
||||
onClick: () => {
|
||||
// WORKAROUND: Dispatch a standard custom event on document
|
||||
document.dispatchEvent(new CustomEvent('bim-demo:open-property-panel'));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user