refactor(01): empty value show '-'

This commit is contained in:
puriphatt 2024-08-16 17:31:40 +07:00
parent 4fedd3ad6a
commit a56ac704ee
3 changed files with 44 additions and 12 deletions

View file

@ -42,8 +42,9 @@ defineProps<{
? $t('formDialogInputEmailHq')
: $t('formDialogInputEmailSubBranch')
"
v-model="email"
for="input-email"
:model-value="readonly ? email || '-' : email"
@update:model-value="(v) => (typeof v === 'string' ? (email = v) : '')"
>
<template #prepend>
<q-icon
@ -67,8 +68,11 @@ defineProps<{
? $t('formDialogInputTelephoneHq')
: $t('formDialogInputTelephoneSubBranch')
"
v-model="telephoneNo"
for="input-telephone-no"
:model-value="readonly ? telephoneNo || '-' : telephoneNo"
@update:model-value="
(v) => (typeof v === 'string' ? (telephoneNo = v) : '')
"
>
<template #prepend>
<q-icon
@ -88,8 +92,9 @@ defineProps<{
hide-bottom-space
class="col-3"
label="Line ID"
v-model="lineId"
for="input-line-id"
:model-value="readonly ? lineId || '-' : lineId"
@update:model-value="(v) => (typeof v === 'string' ? (lineId = v) : '')"
/>
<div class="col-12 row q-col-gutter-sm">
@ -101,8 +106,11 @@ defineProps<{
hide-bottom-space
class="col-3"
:label="$t('formDialogInputContactName')"
v-model="contactName"
for="input-contact-name"
:model-value="readonly ? contactName || '-' : contactName"
@update:model-value="
(v) => (typeof v === 'string' ? (contactName = v) : '')
"
/>
<q-input
@ -113,8 +121,11 @@ defineProps<{
hide-bottom-space
class="col-3"
:label="$t('formDialogInputTelephoneContact')"
v-model="contact"
for="input-contact"
:model-value="readonly ? contact || '-' : contact"
@update:model-value="
(v) => (typeof v === 'string' ? (contact = v) : '')
"
>
<template #prepend>
<q-icon