Skip to content

Commit 890c4c1

Browse files
committed
complte json filter documentation
1 parent 8274f07 commit 890c4c1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

source/api/filters.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ Will result in:
5050
*4 => '4th'*
5151
*5 => '5th'*
5252

53+
### json
54+
55+
- this filter takes one optional argument
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):
58+
59+
``` html
60+
<pre>{&#123;$data | json 4&#125;}</pre>
61+
```
62+
5363
### key
5464

5565
- this filter only works in `v-on`
@@ -143,11 +153,3 @@ You can also use quotes for literal sort key. To indicate a literal reverse, use
143153
<li v-repeat="users | orderBy 'name' -1">{&#123;name&#125;}</li>
144154
</ul>
145155
```
146-
147-
### json
148-
149-
JSON.stringify() incoming value rather than outputting the string representation (i.e. `[object Object]`).
150-
151-
``` html
152-
<pre>{{$data | json}}</pre>
153-
```

0 commit comments

Comments
 (0)