This commit is contained in:
syuilo 2019-04-29 14:37:58 +09:00
parent 1d40afe1b8
commit 6ac44c084d
2 changed files with 12 additions and 1 deletions

View file

@ -43,6 +43,13 @@ export default Vue.extend({
created() {
if (this.value.name == null) Vue.set(this.value, 'name', '');
if (this.value.inputType == null) Vue.set(this.value, 'inputType', 'string');
this.$watch('value.inputType', t => {
if (this.value.default != null) {
if (t === 'number') this.value.default = parseInt(this.value.default, 10);
if (t === 'string') this.value.default = this.value.default.toString();
}
});
},
});
</script>

View file

@ -184,7 +184,11 @@ export default Vue.extend({
this.v = v;
},
v(v) {
this.$emit('input', v);
if (this.type === 'number') {
this.$emit('input', parseInt(v, 10));
} else {
this.$emit('input', v);
}
if (this.withPasswordMeter) {
if (v == '') {