File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -37,18 +37,16 @@ Up till now we have used filters to transform values coming from the model and b
37
37
38
38
``` js
39
39
Vue .filter (' currencyDisplay' , {
40
- currencyDisplay: {
41
- // model -> view
42
- // formats the value when updating the input element.
43
- read : function (val ) {
44
- return ' $' + val .toFixed (2 )
45
- },
46
- // view -> model
47
- // formats the value when updating the data.
48
- write : function (val , oldVal ) {
49
- var number = + val .replace (/ [^ \d. ] / g , ' ' )
50
- return isNaN (number) ? 0 : number
51
- }
40
+ // model -> view
41
+ // formats the value when updating the input element.
42
+ read : function (val ) {
43
+ return ' $' + val .toFixed (2 )
44
+ },
45
+ // view -> model
46
+ // formats the value when updating the data.
47
+ write : function (val , oldVal ) {
48
+ var number = + val .replace (/ [^ \d. ] / g , ' ' )
49
+ return isNaN (number) ? 0 : number
52
50
}
53
51
})
54
52
```
You can’t perform that action at this time.
0 commit comments