File tree Expand file tree Collapse file tree 2 files changed +11
-28
lines changed Expand file tree Collapse file tree 2 files changed +11
-28
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-numeric" ,
3
- "version" : " 1.4.2 " ,
3
+ "version" : " 1.5.0 " ,
4
4
"description" : " Input field component to display currency value based on Vue." ,
5
5
"author" : " Kevin Ongko" ,
6
6
"main" : " src/vue-numeric.vue" ,
Original file line number Diff line number Diff line change @@ -27,14 +27,6 @@ export default {
27
27
type: String
28
28
},
29
29
30
- /**
31
- * Default value.
32
- */
33
- default: {
34
- required: false ,
35
- type: [Number , String ]
36
- },
37
-
38
30
/**
39
31
* Maximum value allowed.
40
32
*/
@@ -110,15 +102,6 @@ export default {
110
102
return this .formatToNumber (this .amount )
111
103
},
112
104
113
- /**
114
- * Number formatted default value.
115
- * @return {Number}
116
- */
117
- defaultValue () {
118
- if (this .default ) return this .formatToNumber (this .default )
119
- return 0
120
- },
121
-
122
105
/**
123
106
* Number formatted minimum value.
124
107
* @return {Number}
@@ -250,18 +233,18 @@ export default {
250
233
}
251
234
},
252
235
253
- watch: {
254
- ' default' (val, old) {
255
- this .processValue (this .defaultValue )
256
- this .formatValue (this .defaultValue )
257
- }
258
- },
259
-
260
236
mounted () {
261
- if (this .defaultValue ) {
262
- this .processValue (this .defaultValue )
263
- this .formatValue (this .defaultValue )
237
+ // Check default value from parent v-model.
238
+ if (this .value ) {
239
+ this .processValue (this .value )
240
+ this .formatValue (this .value )
264
241
}
242
+
243
+ // In case of delayed v-model new value.
244
+ setTimeout (() => {
245
+ this .processValue (this .value )
246
+ this .formatValue (this .value )
247
+ }, 500 )
265
248
}
266
249
}
267
250
</script >
You can’t perform that action at this time.
0 commit comments