summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-29 14:37:58 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-29 14:37:58 +0900
commitc98eb645983e526f387c4cb6e08effb8313ef3a1 (patch)
tree43b92b04263ff092c80102ef0125ccb0ae156061 /src/client
parent11.5.1 (diff)
downloadmisskey-c98eb645983e526f387c4cb6e08effb8313ef3a1.tar.gz
misskey-c98eb645983e526f387c4cb6e08effb8313ef3a1.tar.bz2
misskey-c98eb645983e526f387c4cb6e08effb8313ef3a1.zip
Fix bug
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/views/components/page-editor/page-editor.input.vue7
-rw-r--r--src/client/app/common/views/components/ui/input.vue6
2 files changed, 12 insertions, 1 deletions
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 1f3754252b..4e13840439 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();
+ }
+ });
},
});
</script>
diff --git a/src/client/app/common/views/components/ui/input.vue b/src/client/app/common/views/components/ui/input.vue
index 645062df28..a841ecca11 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 == '') {