diff --git a/README.md b/README.md index 6d89762..d788b7d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ - Component or Directive flavors - Accept copy/paste - Editable +- Min / Max Limits For other types of mask, use [vue-the-mask](https://vuejs-tips.github.io/vue-the-mask) @@ -49,7 +50,9 @@ Vue.use(money, {precision: 4}) prefix: 'R$ ', suffix: ' #', precision: 2, - masked: false + masked: false, + min: Number.MIN_SAFE_INTEGER, + max: Number.MAX_SAFE_INTEGER } } } @@ -79,7 +82,9 @@ Must use `vmodel.lazy` to bind works properly. prefix: 'R$ ', suffix: ' #', precision: 2, - masked: false /* doesn't work with directive */ + masked: false /* doesn't work with directive */, + min: Number.MIN_SAFE_INTEGER, + max: Number.MAX_SAFE_INTEGER } } }, @@ -91,14 +96,17 @@ Must use `vmodel.lazy` to bind works properly. ## Properties -| property | Required | Type | Default | Description | -|-----------|----------|---------|---------|---------------------------------------------------------| -| precision | **true** | Number | 2 | How many decimal places | -| decimal | false | String | "." | Decimal separator | -| thousands | false | String | "," | Thousands separator | -| prefix | false | String | "" | Currency symbol followed by a Space, like "R$ " | -| suffix | false | String | "" | Percentage for example: " %" | -| masked | false | Boolean | false | If the component output should include the mask or not | +| property | Required | Type | Default | Description | +|-----------|----------|---------|-------------------------|---------------------------------------------------------| +| precision | **true** | Number | 2 | How many decimal places | +| precision | **true** | Number | 2 | How many decimal places | +| decimal | false | String | "." | Decimal separator | +| thousands | false | String | "," | Thousands separator | +| prefix | false | String | "" | Currency symbol followed by a Space, like "R$ " | +| suffix | false | String | "" | Percentage for example: " %" | +| masked | false | Boolean | false | If the component output should include the mask or not | +| min | false | Number | Number.MIN_SAFE_INTEGER | The min value allowed | +| max | false | Number | Number.MAX_SAFE_INTEGER | The max value allowed | ### References diff --git a/src/component.vue b/src/component.vue index cfb5cbc..e9bf256 100644 --- a/src/component.vue +++ b/src/component.vue @@ -2,7 +2,7 @@ @@ -35,6 +35,14 @@ export default { type: String, default: () => defaults.thousands }, + max: { + type: Number, + default: () => defaults.max + }, + min: { + type: Number, + default: () => defaults.min + }, prefix: { type: String, default: () => defaults.prefix diff --git a/src/docs/docs.vue b/src/docs/docs.vue index 2f0df75..4b97c27 100644 --- a/src/docs/docs.vue +++ b/src/docs/docs.vue @@ -83,6 +83,18 @@ +