mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-01 05:30:40 +00:00
feat: skeleton 增加全局 catch
This commit is contained in:
parent
8ba26ee880
commit
58b8200fb2
@ -1,12 +1,13 @@
|
||||
import logger from '@ali/vu-logger';
|
||||
import { EventEmitter } from 'events';
|
||||
import { editor } from './editor';
|
||||
import { AppHelper } from '@ali/lowcode-utils';
|
||||
|
||||
/**
|
||||
* Bus class as an EventEmitter
|
||||
*/
|
||||
export class Bus {
|
||||
private emitter = new EventEmitter();
|
||||
private emitter = AppHelper.getInstance();
|
||||
|
||||
getEmitter() {
|
||||
return this.emitter;
|
||||
|
||||
@ -13,6 +13,7 @@ import RightArea from './right-area';
|
||||
import './workbench.less';
|
||||
import { SkeletonContext } from '../context';
|
||||
import { EditorConfig, PluginClassSet } from '@ali/lowcode-types';
|
||||
import { AppHelper } from '@ali/lowcode-utils';
|
||||
|
||||
@observer
|
||||
export class Workbench extends Component<{ skeleton: Skeleton; config?: EditorConfig; components?: PluginClassSet; className?: string; topAreaItemClassName?: string }> {
|
||||
@ -26,6 +27,11 @@ export class Workbench extends Component<{ skeleton: Skeleton; config?: EditorCo
|
||||
return false;
|
||||
}
|
||||
|
||||
componentDidCatch(error: any) {
|
||||
const helper = AppHelper.getInstance();
|
||||
helper.emit('editor.skeleton.workbench.error', error);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { skeleton, className, topAreaItemClassName } = this.props;
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user