feat: 组件未找到文案调整 to #46352540

This commit is contained in:
lingmin.ylm 2023-05-24 20:58:30 +08:00
parent 52272c020f
commit 366a0d8c2a

View File

@ -18,7 +18,12 @@ export default function rendererFactory() {
const debug = Debug('renderer:entry'); const debug = Debug('renderer:entry');
const exceptionStyle = { class FaultComponent extends PureComponent {
render() {
console.error(this.props.error);
console.error('render error', this.props);
return createElement(Div, {
style: {
width: '100%', width: '100%',
height: '50px', height: '50px',
lineHeight: '50px', lineHeight: '50px',
@ -26,26 +31,14 @@ export default function rendererFactory() {
fontSize: '15px', fontSize: '15px',
color: '#ff0000', color: '#ff0000',
border: '2px solid #ff0000', border: '2px solid #ff0000',
borderRadius: '4px', },
};
class FaultComponent extends PureComponent {
render() {
console.error(this.props.error);
console.error('render error', this.props);
return createElement(Div, {
className: 'engine-fault-component',
style: exceptionStyle,
}, '组件渲染异常,请查看控制台日志'); }, '组件渲染异常,请查看控制台日志');
} }
} }
class NotFoundComponent extends PureComponent { class NotFoundComponent extends PureComponent {
render() { render() {
return createElement(Div, { return createElement(Div, this.props, this.props.children || '当前组件未找到,可能已被卸载或删除');
className: 'engine-unknown-component',
style: exceptionStyle,
}, this.props.children || '组件未找到');
} }
} }