mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-06-06 15:40:59 +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 logger from '@ali/vu-logger';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { editor } from './editor';
|
import { editor } from './editor';
|
||||||
|
import { AppHelper } from '@ali/lowcode-utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bus class as an EventEmitter
|
* Bus class as an EventEmitter
|
||||||
*/
|
*/
|
||||||
export class Bus {
|
export class Bus {
|
||||||
private emitter = new EventEmitter();
|
private emitter = AppHelper.getInstance();
|
||||||
|
|
||||||
getEmitter() {
|
getEmitter() {
|
||||||
return this.emitter;
|
return this.emitter;
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import RightArea from './right-area';
|
|||||||
import './workbench.less';
|
import './workbench.less';
|
||||||
import { SkeletonContext } from '../context';
|
import { SkeletonContext } from '../context';
|
||||||
import { EditorConfig, PluginClassSet } from '@ali/lowcode-types';
|
import { EditorConfig, PluginClassSet } from '@ali/lowcode-types';
|
||||||
|
import { AppHelper } from '@ali/lowcode-utils';
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class Workbench extends Component<{ skeleton: Skeleton; config?: EditorConfig; components?: PluginClassSet; className?: string; topAreaItemClassName?: string }> {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidCatch(error: any) {
|
||||||
|
const helper = AppHelper.getInstance();
|
||||||
|
helper.emit('editor.skeleton.workbench.error', error);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { skeleton, className, topAreaItemClassName } = this.props;
|
const { skeleton, className, topAreaItemClassName } = this.props;
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user