Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d8f2d4e

Browse files
committedFeb 24, 2017
Use watch to apply default value
1 parent 787d5d9 commit d8f2d4e

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed
 

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
npm-debug.log
22
node_modules
3+
/.vscode
4+
/.idea

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-numeric",
3-
"version": "1.2.4",
3+
"version": "1.3.0",
44
"description": "Input field component to display currency value based on Vue.",
55
"author": "Kevin Ongko",
66
"main": "src/vue-numeric.vue",

‎src/vue-numeric.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,10 @@ export default {
224224
}
225225
},
226226
227-
mounted () {
228-
// Apply default value if available.
229-
if (this.default) this.processValue(this.defaultValue)
227+
watch: {
228+
'default' (val, old) {
229+
this.processValue(this.defaultValue)
230+
}
230231
}
231232
}
232233
</script>

0 commit comments

Comments
 (0)
Please sign in to comment.