修复修改窗口大小对话框手动输入数字时只会应用上一个数字的BUG

This commit is contained in:
fangxiang 2022-09-16 14:06:22 +08:00
parent 66175ed579
commit 1f781e1f7a
1 changed files with 26 additions and 16 deletions

View File

@ -84,7 +84,6 @@
parseInt(val) >= 0 || parseInt(val) >= 0 ||
$t('the number must be greater than 0'), $t('the number must be greater than 0'),
]" ]"
@update:model-value="onXChanged"
lazy-rules lazy-rules
> >
<template v-slot:append> <template v-slot:append>
@ -105,7 +104,6 @@
type="number" type="number"
min="0" min="0"
v-model="window_rect.y" v-model="window_rect.y"
@update:model-value="onYChanged"
:rules="[ :rules="[
(val) => (val) =>
(val != null && (val != null &&
@ -136,7 +134,6 @@
<q-input <q-input
type="number" type="number"
min="1" min="1"
@update:model-value="onWidthChanged"
v-model="window_rect.width" v-model="window_rect.width"
:rules="[ :rules="[
(val) => (val) =>
@ -167,7 +164,6 @@
<q-input <q-input
type="number" type="number"
min="1" min="1"
@update:model-value="onHeightChanged"
v-model="window_rect.height" v-model="window_rect.height"
:rules="[ :rules="[
(val) => (val) =>
@ -348,6 +344,32 @@ export default defineComponent({
); );
}; };
watch(
() => window_rect.x,
() => {
sendSetWindowGeometryMessage();
}
);
watch(
() => window_rect.y,
() => {
sendSetWindowGeometryMessage();
}
);
watch(
() => window_rect.width,
() => {
sendSetWindowGeometryMessage();
}
);
watch(
() => window_rect.height,
() => {
sendSetWindowGeometryMessage();
}
);
return { return {
show_dialog, show_dialog,
loading, loading,
@ -487,18 +509,6 @@ export default defineComponent({
window_rect.height = back_window_rect.height; window_rect.height = back_window_rect.height;
sendSetWindowGeometryMessage(); sendSetWindowGeometryMessage();
}, },
onHeightChanged(value: number) {
sendSetWindowGeometryMessage();
},
onWidthChanged(value: number) {
sendSetWindowGeometryMessage();
},
onXChanged(value: number) {
sendSetWindowGeometryMessage();
},
onYChanged(value: number) {
sendSetWindowGeometryMessage();
},
}; };
}, },
}); });