fix UI & add unchanged

This commit is contained in:
xue jiahao
2024-12-23 23:08:55 +08:00
parent 57af07ba73
commit 972bbf9013
6 changed files with 46 additions and 33 deletions

View File

@@ -1,12 +1,17 @@
<template>
<q-input
ref="nameRef"
v-model="versionInfo.name"
filled
autofocus
label="バージョン名"
:rules="[(val) => !val || val.length <= 80 || '80字以内で入力ください']"
:rules="[
val => !!val || 'バージョン名を入力してください。',
(val) => !val || val.length <= 80 || '80字以内で入力ください'
]"
/>
<q-input
ref="commentRef"
v-model="versionInfo.comment"
filled
type="textarea"
@@ -19,6 +24,15 @@ import { ref, watch, defineProps, defineEmits } from 'vue';
import { QInput } from 'quasar';
import { IVersionSubmit } from 'src/types/AppTypes';
const nameRef = ref();
const commentRef = ref();
const isValid = () => {
const nameHasError = nameRef.value?.hasError ?? false;
const commentHasError = commentRef.value?.hasError ?? false;
return !nameHasError && !commentHasError;
};
const props = defineProps<{
modelValue: IVersionSubmit;
}>();
@@ -33,6 +47,10 @@ const versionInfo = ref({
const emit = defineEmits(['update:modelValue']);
defineExpose({
isValid
})
watch(
versionInfo,
() => {