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: README.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,20 @@
4
4
5
5
This is a simple wrapper for [Numeral.js](http://numeraljs.com/).
6
6
7
+
## Numeral.js 2 required
8
+
9
+
This package requires you to install Numeral.js as a peer dependency (`numeral@^2`). This way, you can use a different version of Numeral, or even a drop-in replacement with the same API.
10
+
Use [version 1 of this package](https://www.npmjs.com/package/vue-filter-number-format/v/1.0.3) if you want it to install its own Numeral.js dependency as part of the bundle.
11
+
7
12
## Suggested usage
8
13
9
-
Register globally as a Vue filter in your main.js-ish file:
14
+
Pass in Numeral to create the formatter function, and register globally as a Vue filter in your main.js-ish file:
10
15
11
16
```js
17
+
importnumeralfrom'numeral';
12
18
importnumFormatfrom'vue-filter-number-format';
13
19
14
-
Vue.filter('numFormat', numFormat);
20
+
Vue.filter('numFormat', numFormat(numeral));
15
21
16
22
// new Vue ...
17
23
```
@@ -31,6 +37,8 @@ See the [Numeral.js docs](http://numeraljs.com/) for other formatting options.
31
37
32
38
## Development
33
39
40
+
For convenience, this function is bundled with a VueJS dev site.
0 commit comments