You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/api/filters.md
+26-26
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,19 @@ order: 7
17
17
18
18
### currency
19
19
20
-
-this filter takes one optional argument
20
+
-这个 filter 接受一个可选参数
21
21
22
22
*12345 => $12,345.00*
23
23
24
-
You can pass an optional argument which will be used as the currency symbol (default is $).
24
+
你可以传递一个可选参数来表示货币符号
25
25
26
26
### pluralize
27
27
28
-
-this filter takes at least one argument
28
+
-这个 filter 接受至少一个参数
29
29
30
-
Pluralizes the argument based on the filtered value. When there is exactly one arg, plural forms simply add an "s" at the end. When there are more than one argument, the arguments will be used as array of strings corresponding to the single, double, triple ... forms of the word to be pluralized. When the number to be pluralized exceeds the length of the args, it will use the last entry in the array.
@@ -42,7 +42,7 @@ Pluralizes the argument based on the filtered value. When there is exactly one a
42
42
{{date}}{{date | pluralize st nd rd th}}
43
43
```
44
44
45
-
Will result in:
45
+
结果为:
46
46
47
47
*1 => '1st'*
48
48
*2 => '2nd'*
@@ -52,20 +52,20 @@ Will result in:
52
52
53
53
### json
54
54
55
-
-this filter takes one optional argument
55
+
-这个 filter 接受一个可选参数
56
56
57
-
JSON.stringify() incoming value rather than outputting the string representation (i.e. `[object Object]`). It also takes one optional argument which is the indent level (defaults to 2):
@@ -76,22 +76,22 @@ Wrap the handler so it only gets called when the keyCode matches the argument. Y
76
76
- left
77
77
- right
78
78
79
-
**Example:**
79
+
**例子:**
80
80
81
81
```html
82
82
<inputv-on="keyup:doSomething | key enter">
83
83
```
84
84
85
-
`doSomething`will only be called when the Enter key is pressed.
85
+
只有按回车键(enter)时才会调用 `doSomething`。
86
86
87
87
### filterBy
88
88
89
-
**Syntax:**`filterBy searchKey [in dataKey]`.
89
+
**语法:**`filterBy searchKey [in dataKey]`.
90
90
91
-
-this filter only works in`v-repeat`
92
-
-this is a computed filter
91
+
-这个 filter 只工作于`v-repeat`
92
+
-这是一个 computed filter
93
93
94
-
Make`v-repeat`only display a filtered version of the source Array. The `searchKey`argument is a property key on the context ViewModel. The value of that property will be used as the string to search for:
@@ -100,9 +100,9 @@ Make `v-repeat` only display a filtered version of the source Array. The `search
100
100
</ul>
101
101
```
102
102
103
-
When the filter is applied, it will filter the `users`Array by recursively searching for the current value of `searchText`on each item in the Array. For example, if an item is `{ name: 'Jack', phone: '555-123-4567' }` and `searchText`has value `'555'`, the item will be considered a match.
Optionally, you can narrow down which specific property to search in with the optional `in dataKey`argument:
105
+
可选地,你可以通过 `in dataKey`参数来指定具体要查找哪个属性:
106
106
107
107
```html
108
108
<inputv-model="searchText">
@@ -111,9 +111,9 @@ Optionally, you can narrow down which specific property to search in with the op
111
111
</ul>
112
112
```
113
113
114
-
Now the item will only match if the value of `searchText` is found in its `name` property. So `searchText`with value `'555'`will no longer match this item, but `'Jack'`will.
Finally, you can use quotes to indicate literal arguments:
116
+
最后,你可以使用引号来表示字面量参数:
117
117
118
118
```html
119
119
<ul>
@@ -123,12 +123,12 @@ Finally, you can use quotes to indicate literal arguments:
123
123
124
124
### orderBy
125
125
126
-
**Syntax:**`orderBy sortKey [reverseKey]`.
126
+
**语法:**`orderBy sortKey [reverseKey]`.
127
127
128
-
-this filter only works in`v-repeat`
129
-
-this is a computed filter
128
+
-这个 filter 只工作于`v-repeat`
129
+
-这是一个 computed filter
130
130
131
-
Sort`v-repeat`'s displayed result. The `sortKey` argument is a property key on the context ViewModel. The value of that property will be used as the key to sort the Array items with. The optional `reverseKey`argument is also a property key on the context ViewModel, but the value's truthiness will determine whether the result should be reversed.
0 commit comments