代码如下,我希望title可以根据@input内穿的参动态改变,怎么实现呢?
@Input()
id: string;
pageTitleName: string;
@ViewChild('sf', { static: false }) sf: SFComponent;
formData = {};
schema = {
properties: {
creator: {
type: 'string',
title: '名称',
},
gender: {
type: 'string',
title: '性别',
ui: {
widget: 'radio',
asyncData: () =>
of([
{ label: '男', value: 'Man' },
{ label: '女', value: 'Woman' },
]).pipe(delay(100)),
grid: {
span: 12,
},
} as SFRadioWidgetSchema,
default: '',
},
type: {
type: 'string',
title: '记录类型',
},
title: {
type: 'string',
title: this.pageTitleName,
},
description: {
type: 'string',
title: '详情',
},
startDate: {
type: 'string',
title: '开始时间',
format: 'date',
},
endDate: {
type: 'string',
title: '结束时间',
format: 'date',
},
},
ui: {
spanLabelFixed: 70,
grid: {
span: 24,
},
},
required: ['title', 'creator', 'gender', 'type', 'description', 'startDate', 'endDate'],
};
layout = 'horizontal';