fix: set default value as 0 in int field
This commit is contained in:
parent
4cfa0f512b
commit
e7a20374c7
@ -211,7 +211,7 @@ const filterOptions = createResource({
|
||||
|
||||
const options = computed(() => {
|
||||
let searchedContacts = props.fetchContacts ? filterOptions.data : []
|
||||
if (!searchedContacts.length && query.value) {
|
||||
if (!searchedContacts?.length && query.value) {
|
||||
searchedContacts.push({
|
||||
label: query.value,
|
||||
value: query.value,
|
||||
|
||||
@ -136,7 +136,6 @@
|
||||
<DateTimePicker
|
||||
v-else-if="field.fieldtype === 'Datetime'"
|
||||
:value="data[field.fieldname]"
|
||||
icon-left=""
|
||||
:formatter="(date) => getFormat(date, '', true, true)"
|
||||
:placeholder="getPlaceholder(field)"
|
||||
input-class="border-none"
|
||||
@ -144,7 +143,6 @@
|
||||
/>
|
||||
<DatePicker
|
||||
v-else-if="field.fieldtype === 'Date'"
|
||||
icon-left=""
|
||||
:value="data[field.fieldname]"
|
||||
:formatter="(date) => getFormat(date, '', true)"
|
||||
:placeholder="getPlaceholder(field)"
|
||||
@ -162,10 +160,10 @@
|
||||
@change="fieldChange($event.target.value, field)"
|
||||
/>
|
||||
<FormattedInput
|
||||
v-else-if="['Int'].includes(field.fieldtype)"
|
||||
type="number"
|
||||
v-else-if="field.fieldtype === 'Int'"
|
||||
type="text"
|
||||
:placeholder="getPlaceholder(field)"
|
||||
:value="data[field.fieldname]"
|
||||
:value="data[field.fieldname] || '0'"
|
||||
:disabled="Boolean(field.read_only)"
|
||||
:description="field.description"
|
||||
@change="fieldChange($event.target.value, field)"
|
||||
|
||||
@ -279,7 +279,7 @@
|
||||
v-else-if="field.fieldtype === 'Int'"
|
||||
class="form-control"
|
||||
type="text"
|
||||
v-model="document.doc[field.fieldname]"
|
||||
:value="document.doc[field.fieldname] || '0'"
|
||||
:placeholder="field.placeholder"
|
||||
:debounce="500"
|
||||
@change.stop="fieldChange($event.target.value, field)"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user