mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 17:53:07 +02:00
Fix bug
This commit is contained in:
parent
a58df29208
commit
c98eb64598
2 changed files with 12 additions and 1 deletions
|
@ -43,6 +43,13 @@ export default Vue.extend({
|
||||||
created() {
|
created() {
|
||||||
if (this.value.name == null) Vue.set(this.value, 'name', '');
|
if (this.value.name == null) Vue.set(this.value, 'name', '');
|
||||||
if (this.value.inputType == null) Vue.set(this.value, 'inputType', 'string');
|
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>
|
</script>
|
||||||
|
|
|
@ -184,7 +184,11 @@ export default Vue.extend({
|
||||||
this.v = v;
|
this.v = v;
|
||||||
},
|
},
|
||||||
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 (this.withPasswordMeter) {
|
||||||
if (v == '') {
|
if (v == '') {
|
||||||
|
|
Loading…
Reference in a new issue