Created
October 24, 2017 07:17
-
-
Save gearmobile/d957d3c79df13bcdb9482cbc0fae9615 to your computer and use it in GitHub Desktop.
Vue.js Props with validation and default value via return function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
props: { | |
value: { | |
type: Number, | |
default () { return 2 } | |
}, | |
min: { | |
type: Number, | |
default () { return 1 } | |
}, | |
max: { | |
type: Number, | |
default () { return 10 } | |
} | |
} | |
<input type="range" v-model="value" :min="min" :max="max"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment