Merge pull request #468 from RickCole21/master

service命中改回去
This commit is contained in:
liaoxuezhi 2020-02-28 10:53:20 +08:00 committed by GitHub
commit be462a25d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import {observer} from 'mobx-react';
import {ServiceStore, IServiceStore} from '../../store/service';
@Renderer({
test: /(^|\/)form(?:\/.+)?\/control\/(?:\d+\/)?service$/,
test: /(^|\/)form\/(.*)\/service$/,
weight: -100,
storeType: ServiceStore.name,
storeExtendsData: false,
@ -25,7 +25,9 @@ export class ServiceRenderer extends BasicService {
componentDidMount() {
const {formInited, addHook} = this.props;
if (formInited) {
// form层级下的所有service应该都会走这里
// 但是传入props有可能是undefined所以做个处理
if (formInited !== false) {
super.componentDidMount();
} else {
addHook && addHook(this.initFetch, 'init');
@ -34,7 +36,7 @@ export class ServiceRenderer extends BasicService {
componentDidUpdate(prevProps: ServiceProps) {
const {formInited} = this.props;
if (formInited) {
if (formInited !== false) {
super.componentDidUpdate(prevProps);
}
}