替换containsAllLable
This commit is contained in:
@ -27,7 +27,7 @@ export class DictSelectComponent implements OnInit, ControlValueAccessor {
|
||||
@Input() params = {};// 请求参数
|
||||
|
||||
dictList: any[] = [];
|
||||
@Input() containsAllLable = true; // 是否包含全部这一选项
|
||||
@Input() containsAllLabel = true; // 是否包含全部这一选项
|
||||
@Input() mode: 'multiple' | 'tags' | 'default' = 'default';
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ export class DictSelectComponent implements OnInit, ControlValueAccessor {
|
||||
this.service.getDictList(this.url || this.defaultUrl, this.params).subscribe(res => {
|
||||
if (res) {
|
||||
this.dictList = res || [];
|
||||
if (this.dictList.length > 0 && this.containsAllLable) {
|
||||
if (this.dictList.length > 0 && this.containsAllLabel) {
|
||||
const obj = { label: '全部', value: '' };
|
||||
this.dictList.unshift(obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user