1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-21 19:15:32 +02:00

fix(frontend): MkFormで入力に不備がある場合は完了ボタンを押して続行できないように (#17096)

* fix(frontend): MkFormで入力に不備がある場合は完了ボタンを押して続行できないように

* fix lint
This commit is contained in:
かっこかり
2026-01-13 15:02:50 +09:00
committed by GitHub
parent c0d5c0df69
commit f3aa5081ed
5 changed files with 68 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
:width="450"
:canClose="false"
:withOkButton="true"
:okButtonDisabled="false"
:okButtonDisabled="!canSave"
@click="cancel()"
@ok="ok()"
@close="cancel()"
@@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<div class="_spacer" style="--MI_SPACER-min: 20px; --MI_SPACER-max: 32px;">
<MkForm v-model="values" :form="form"/>
<MkForm v-model="values" :form="form" @canSaveStateChange="onCanSaveStateChanged"/>
</div>
</MkModalWindow>
</template>
@@ -59,7 +59,15 @@ const values = ref((() => {
return obj;
})());
const canSave = ref(true);
function onCanSaveStateChanged(newCanSave: boolean) {
canSave.value = newCanSave;
}
function ok() {
if (!canSave.value) return;
emit('done', {
result: values.value,
});