cipchk / nz-schema-form

ng-zorro-antd form generation based on JSON-Schema
MIT License
40 stars 14 forks source link

采用refreshSchema刷新后select宽度变小 #34

Closed limingyao-xx closed 6 years ago

limingyao-xx commented 6 years ago

`@ViewChild('sf') sf: FormComponent; schema: SFSchema = { properties: { app: { type: 'string', title: '附属应用', widget: 'select', enum: [] } } };

ngOnInit() { this.http.get('/apps').subscribe((res: any) => { this.schema.properties.app.enum = res; this.sf.refreshSchema(); }); }`

采用这种方式设置default后,select的宽度变小。如图:

1

cipchk commented 6 years ago

这是 ng-zorro-antd 的一个样式BUG,所以最好在 schema 的 widgets 中指定 style 内容即可。

limingyao-xx commented 6 years ago

测试了下,设置widget的style:‘width:200px’有效,但设置百分比无效。还有其它方案么?

cipchk commented 6 years ago

据我所知,没有。