NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.85k stars 3.9k forks source link

tree-select给nz-tree组件增加nzSearchFunc输入参数 #8707

Open yjq635 opened 3 weeks ago

yjq635 commented 3 weeks ago

What problem does this feature solve?

支持自定义搜索逻辑,以实现 非title字段的搜索. 比如按拼音或者拼音首字母缩写搜索,可以把中文对应的拼音和对应的拼音首字母缩写以及title拼接起来放在另外一个字段,搜索的时候从这个新字段匹配

What does the proposed API look like?


<nz-tree-select
      style="width: 250px"
      [nzExpandedKeys]="expandKeys"
      [nzNodes]="nodes"
      nzShowSearch
      nzPlaceHolder="Please select"
      [(ngModel)]="value"
      [nzSearchFunc]="nzSearchFunc"
      (ngModelChange)="onChange($event)"
    ></nz-tree-select>
```<!-- generated by ng-zorro-issue-helper. DO NOT REMOVE -->
zorro-bot[bot] commented 3 weeks ago

Translation of this issue:

TREE-SELECT adds NZSearchfunc input parameters to NZ-Tree components

What PROBLEM DOES This Feature Solve?

Support customized search logic to achieve search for non -Title fields. For example, search according to Pinyin or Pinyin's first letter abbreviation, you can put the corresponding Pinyin and the corresponding pinyin first letter abbreviation and the title stitching on another field. When searching, it matches this new field.

What does the proposed api look like?

` <nz-time-select style = "width: 250px" [nzexpandedkeys] = "Expandkeys" [nznodes] = "nodes" nzshowsearch nzplaceholder = "Please Select" [(ngmodel)] = "Value" [nzsearchfunc] = "nzsearchFunc" (ngmodelchange) = "Onchange ($ Event)"

`