Add save version dialog
# Conflicts: # frontend/src/types/AppTypes.ts
This commit is contained in:
39
frontend/src/components/dialog/VersionInput.vue
Normal file
39
frontend/src/components/dialog/VersionInput.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<q-input
|
||||
v-model="versionInfo.name"
|
||||
filled
|
||||
label="バージョン名"
|
||||
:rules="[(val) => val.length <= 20 || '20字以内で入力ください']"
|
||||
/>
|
||||
<q-input
|
||||
v-model="versionInfo.desc"
|
||||
filled
|
||||
type="textarea"
|
||||
:rules="[(val) => val.length <= 80 || '80字以内で入力ください']"
|
||||
label="説明"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, defineProps, defineEmits } from 'vue';
|
||||
import { QInput } from 'quasar';
|
||||
import { IVersionInfo } from 'src/types/AppTypes';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: IVersionInfo;
|
||||
}>();
|
||||
|
||||
const versionInfo = ref({
|
||||
...props.modelValue,
|
||||
name: props.modelValue.name || `新バージョン ${new Date().toLocaleString()}`,
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
watch(
|
||||
versionInfo,
|
||||
() => {
|
||||
emit('update:modelValue', { ...versionInfo.value });
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
</script>
|
||||
Reference in New Issue
Block a user