Skip to content

Commit 7666a54

Browse files
re-fortkazupon
authored andcommitted
Update filters, global filters needs to go before Vue instance creation (#671)
* Update filters, global filters needs to go before Vue instance creation * Update date
1 parent e3e8252 commit 7666a54

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/v2/guide/filters.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: フィルター
3-
updated: 2017-12-03
3+
updated: 2018-01-30
44
type: guide
55
order: 305
66
---
@@ -27,14 +27,18 @@ filters: {
2727
}
2828
```
2929

30-
もしくはグローバルでフィルタを定義することもできます:
30+
もしくは Vue インスタンスを作成する前にグローバルでフィルタを定義することもできます:
3131

3232
``` js
3333
Vue.filter('capitalize', function (value) {
3434
if (!value) return ''
3535
value = value.toString()
3636
return value.charAt(0).toUpperCase() + value.slice(1)
3737
})
38+
39+
new Vue({
40+
// ...
41+
})
3842
```
3943

4044
以下は `capitalize` フィルタの使用例です。

0 commit comments

Comments
 (0)