refactor: 型定義をよりよくした
This commit is contained in:
parent
3aa6aa006b
commit
5d35a37ccf
|
@ -64,8 +64,10 @@ const props = defineProps<{
|
||||||
targetUserPattern: string | null;
|
targetUserPattern: string | null;
|
||||||
reporterPattern: string | null;
|
reporterPattern: string | null;
|
||||||
reportContentPattern: string | null;
|
reportContentPattern: string | null;
|
||||||
|
expirationDate: string | null;
|
||||||
expiresAt: string;
|
expiresAt: string;
|
||||||
forward: boolean;
|
forward: boolean;
|
||||||
|
beforeExpiresAt?: string;
|
||||||
}
|
}
|
||||||
}>();
|
}>();
|
||||||
let expirationDate: string | null = $ref(null);
|
let expirationDate: string | null = $ref(null);
|
||||||
|
@ -83,8 +85,10 @@ const value = computed({
|
||||||
targetUserPattern: '',
|
targetUserPattern: '',
|
||||||
reporterPattern: '',
|
reporterPattern: '',
|
||||||
reportContentPattern: '',
|
reportContentPattern: '',
|
||||||
|
expirationDate: null,
|
||||||
expiresAt: 'indefinitely',
|
expiresAt: 'indefinitely',
|
||||||
forward: false,
|
forward: false,
|
||||||
|
beforeExpiresAt: null,
|
||||||
};
|
};
|
||||||
for (const [key, _value] of Object.entries(data)) {
|
for (const [key, _value] of Object.entries(data)) {
|
||||||
if (_value === null) {
|
if (_value === null) {
|
||||||
|
@ -94,7 +98,7 @@ const value = computed({
|
||||||
if (props.modelValue && props.editable) {
|
if (props.modelValue && props.editable) {
|
||||||
emit('update:modelValue', data);
|
emit('update:modelValue', data);
|
||||||
}
|
}
|
||||||
return data as unknown as Exclude<NonNullType<typeof props.modelValue>, undefined>;
|
return data as NonNullType<typeof data>;
|
||||||
},
|
},
|
||||||
set(updateValue) {
|
set(updateValue) {
|
||||||
if (props.modelValue && props.editable) {
|
if (props.modelValue && props.editable) {
|
||||||
|
|
Loading…
Reference in New Issue