Skip to content

Commit be80f97

Browse files
add allowClear and update docs
1 parent 054648f commit be80f97

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

dist/vue-numeric.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ <h2 class="subtitle">
3434
<vue-numeric
3535
class="input is-large"
3636
v-model="money"
37+
:allow-clear="allowClear"
38+
:empty-value="emptyValue"
3739
:min="minValue"
3840
:max="maxValue"
3941
:currency="currency"
@@ -77,6 +79,12 @@ <h1 class="title is-4">
7779
<input class="input" type="number" v-model.number="decimals">
7880
</p>
7981
</div>
82+
<div class="column is-12">
83+
<p class="control">
84+
<label class="label"> Empty Value </label>
85+
<input class="input" type="text" v-model="emptyValue">
86+
</p>
87+
</div>
8088
<div class="column is-12">
8189
<label class="label"> Separator </label>
8290
<p class="control">
@@ -100,6 +108,12 @@ <h1 class="title is-4">
100108
Read Only
101109
</p>
102110
</div>
111+
<div class="column is-12">
112+
<p class="control">
113+
<input type="checkbox" v-model="allowClear">
114+
Allow clear
115+
</p>
116+
</div>
103117
</div>
104118
</div>
105119

@@ -143,6 +157,8 @@ <h1 class="title is-4">
143157

144158
data: {
145159
money: 1000,
160+
allowClear: true,
161+
emptyValue: '',
146162
minValue: 0,
147163
maxValue: 999999,
148164
currency: '$',

src/vue-numeric.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:placeholder="placeholder"
66
:disabled="disabled"
77
v-model="amount"
8-
type="tel"
8+
:type="allowClear ? 'search' : 'tel'"
99
@blur="onBlurHandler"
1010
@input="onInputHandler"
1111
@focus="onFocusHandler"
@@ -24,6 +24,15 @@ export default {
2424
name: 'VueNumeric',
2525
2626
props: {
27+
/**
28+
* Allow clear.
29+
*/
30+
allowClear: {
31+
type: Boolean,
32+
default: false,
33+
required: false
34+
},
35+
2736
/**
2837
* Currency symbol.
2938
*/

0 commit comments

Comments
 (0)