多选多级下拉框案例

忘了在哪儿找的啦

  viewValue: string[] = [];
  carProperties = [
    { value: 'Stereo' },
    {
      value: 'Radio',
      subProperties: [
        { value: 'Digital' },
        { value: 'FM' }
      ]
    }, { value: 'Child seats' },
    { value: 'Rear camera' }
  ];

  valueSelected(value: string): boolean {
    return this.viewValue.indexOf(value) !== -1;
  }
test {{ property.value }}
{{ subProperty.value }}

你可能感兴趣的:(多选多级下拉框案例)