@@ -19,68 +19,64 @@ import { NzMentionModule } from 'ng-zorro-antd/mention';
19
19
20
20
``` html
21
21
<nz-mention [nzSuggestions] =" suggestions" >
22
- <textarea
23
- nz-input
24
- [(ngModel)] =" value"
25
- nzMentionTrigger >
26
- </textarea >
22
+ <textarea nz-input [(ngModel)] =" value" nzMentionTrigger > </textarea >
27
23
</nz-mention >
28
24
```
29
25
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> ` | - |
45
41
46
42
#### Methods
47
43
48
- | Name | Description |
49
- | --- | --- |
44
+ | Name | Description |
45
+ | ----------- | ---------------------------------------------------- --- |
50
46
| getMentions | Get the mentions array in the ` input[nzMentionTrigger] ` |
51
47
52
48
### nzMentionTrigger
49
+
53
50
Trigger element
54
51
55
52
``` html
56
53
<nz-mention >
57
- <textarea nzMentionTrigger ></textarea >
54
+ <textarea nzMentionTrigger ></textarea >
58
55
</nz-mention >
59
56
```
60
57
61
58
``` html
62
59
<nz-mention >
63
- <input nzMentionTrigger >
60
+ <input nzMentionTrigger / >
64
61
</nz-mention >
65
62
```
66
63
67
64
### nzMentionSuggestion
65
+
68
66
Customize the suggestion template
69
67
70
68
``` 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 >
79
75
```
80
76
81
77
### MentionOnSearchTypes
82
78
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