@@ -19,68 +19,64 @@ import { NzMentionModule } from 'ng-zorro-antd/mention';
1919
2020``` html
2121<nz-mention [nzSuggestions] =" suggestions" >
22- <textarea
23- nz-input
24- [(ngModel)] =" value"
25- nzMentionTrigger >
26- </textarea >
22+ <textarea nz-input [(ngModel)] =" value" nzMentionTrigger > </textarea >
2723</nz-mention >
2824```
2925
30- ### nz-mention
31-
32- | Property | Description | Type | Default |
33- | --- | --- | --- | --- |
34- | ` [nzMentionTrigger] ` | Trigger element ** (required)** | ` HTMLTextAreaElement \| HTMLInputElement ` | - |
35- | ` [nzMentionSuggestion] ` | Customize the suggestion template | ` TemplateRef<any> ` | - |
36- | ` [nzLoading] ` | Loading mode | ` boolean ` | ` false ` |
37- | ` [nzNotFoundContent] ` | Suggestion when suggestions empty | ` string ` | ` '无匹配结果,轻敲空格完成输入' ` |
38- | ` [nzPlacement] ` | The position of the suggestion relative to the target, which can be one of top and bottom | ` 'button' \| 'top' ` | ` 'bottom' ` |
39- | ` [nzPrefix] ` | Character which will trigger Mention to show mention list | ` string \| string[] ` | ` '@' ` |
40- | ` [nzSuggestions] ` | Suggestion content | ` any[] ` | ` [] ` |
41- | ` [nzStatus] ` | Set validation status | ` 'error' \| 'warning' ` | - |
42- | ` [nzValueWith] ` | Function that maps an suggestion's value | ` (any) => string \| (value: string) => string ` |
43- | ` (nzOnSelect) ` | Callback function called when select from suggestions | ` EventEmitter<any> ` | - |
44- | ` (nzOnSearchChange) ` | Callback function called when search content changes| ` EventEmitter<MentionOnSearchTypes> ` | - |
26+ ### nz-mention: standalone
27+
28+ | Property | Description | Type | Default |
29+ | ----------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------- --- |
30+ | ` [nzMentionTrigger] ` | Trigger element ** (required)** | ` HTMLTextAreaElement \| HTMLInputElement ` | - |
31+ | ` [nzMentionSuggestion] ` | Customize the suggestion template | ` TemplateRef<any> ` | - |
32+ | ` [nzLoading] ` | Loading mode | ` boolean ` | ` false ` |
33+ | ` [nzNotFoundContent] ` | Suggestion when suggestions empty | ` string ` | ` '无匹配结果,轻敲空格完成输入' ` |
34+ | ` [nzPlacement] ` | The position of the suggestion relative to the target, which can be one of top and bottom | ` 'button' \| 'top' ` | ` 'bottom' ` |
35+ | ` [nzPrefix] ` | Character which will trigger Mention to show mention list | ` string \| string[] ` | ` '@' ` |
36+ | ` [nzSuggestions] ` | Suggestion content | ` any[] ` | ` [] ` |
37+ | ` [nzStatus] ` | Set validation status | ` 'error' \| 'warning' ` | - |
38+ | ` [nzValueWith] ` | Function that maps an suggestion's value | ` (any) => string \| (value: string) => string ` |
39+ | ` (nzOnSelect) ` | Callback function called when select from suggestions | ` EventEmitter<any> ` | - |
40+ | ` (nzOnSearchChange) ` | Callback function called when search content changes | ` EventEmitter<MentionOnSearchTypes> ` | - |
4541
4642#### Methods
4743
48- | Name | Description |
49- | --- | --- |
44+ | Name | Description |
45+ | ----------- | ---------------------------------------------------- --- |
5046| getMentions | Get the mentions array in the ` input[nzMentionTrigger] ` |
5147
5248### nzMentionTrigger
49+
5350Trigger element
5451
5552``` html
5653<nz-mention >
57- <textarea nzMentionTrigger ></textarea >
54+ <textarea nzMentionTrigger ></textarea >
5855</nz-mention >
5956```
6057
6158``` html
6259<nz-mention >
63- <input nzMentionTrigger >
60+ <input nzMentionTrigger / >
6461</nz-mention >
6562```
6663
6764### nzMentionSuggestion
65+
6866Customize the suggestion template
6967
7068``` html
71- <nz-mention
72- [nzSuggestions] =" items"
73- [nzValueWith] =" valueWith" >
74- <input nz-input nzMentionTrigger >
75- <ng-container *nzMentionSuggestion =" let item" >
76- <span >{{ item.label }} - {{ item.value }}</span >
77- </ng-container >
78- </nz-mention >
69+ <nz-mention [nzSuggestions] =" items" [nzValueWith] =" valueWith" >
70+ <input nz-input nzMentionTrigger />
71+ <ng-container *nzMentionSuggestion =" let item" >
72+ <span >{{ item.label }} - {{ item.value }}</span >
73+ </ng-container >
74+ </nz-mention >
7975```
8076
8177### MentionOnSearchTypes
8278
83- | Property | Description | Type | Default |
84- | -------- | ----------- | ---- | ------- |
85- | value | Search keyword | ` string ` | - |
86- | prefix | prefix | ` string ` | - |
79+ | Property | Description | Type | Default |
80+ | -------- | -------------- | ---- ---- | ------- |
81+ | value | Search keyword | ` string ` | - |
82+ | prefix | prefix | ` string ` | - |
0 commit comments