From 6ac44c084dde1931b20d093e9792ccf858f80278 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 29 Apr 2019 14:37:58 +0900 Subject: [PATCH 1/8] Fix bug --- .../views/components/page-editor/page-editor.input.vue | 7 +++++++ src/client/app/common/views/components/ui/input.vue | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/client/app/common/views/components/page-editor/page-editor.input.vue b/src/client/app/common/views/components/page-editor/page-editor.input.vue index 1f3754252..4e1384043 100644 --- a/src/client/app/common/views/components/page-editor/page-editor.input.vue +++ b/src/client/app/common/views/components/page-editor/page-editor.input.vue @@ -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(); + } + }); }, }); diff --git a/src/client/app/common/views/components/ui/input.vue b/src/client/app/common/views/components/ui/input.vue index 645062df2..a841ecca1 100644 --- a/src/client/app/common/views/components/ui/input.vue +++ b/src/client/app/common/views/components/ui/input.vue @@ -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 == '') { From 69b52e13a7da8c811e64794fb3d84e964b4b16df Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 29 Apr 2019 14:38:06 +0900 Subject: [PATCH 2/8] :art: --- .../app/common/views/components/ui/button.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/client/app/common/views/components/ui/button.vue b/src/client/app/common/views/components/ui/button.vue index 7b443a1ac..adf43f6d8 100644 --- a/src/client/app/common/views/components/ui/button.vue +++ b/src/client/app/common/views/components/ui/button.vue @@ -1,7 +1,7 @@