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: src/guide/migration/filters.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -75,17 +75,17 @@ Instead of using filters, we recommend replacing them with computed properties o
75
75
76
76
### Global Filters
77
77
78
-
If you are using filters that were globally registered and then used throughout our app, it's likely not convenient to replace them with computed props or methods in each individual component.
78
+
If you are using filters that were globally registered and then used throughout your app, it's likely not convenient to replace them with computed properties or methods in each individual component.
79
79
80
-
Instead, you can make your global filters available to all components through `app.globalProperties`:
80
+
Instead, you can make your global filters available to all components through [globalProperties](../../api/application-config.html#globalproperties):
81
81
82
82
```javascript
83
83
// main.js
84
84
constapp=createApp(App)
85
85
86
86
app.config.globalProperties.$filters= {
87
-
accountInUSD(num) {
88
-
return'$'+num
87
+
currencyUSD(value) {
88
+
return'$'+value
89
89
}
90
90
}
91
91
```
@@ -95,7 +95,7 @@ Then you can fix all templates using this `$filters` object like this:
0 commit comments