feat: disable create new if not select branch
This commit is contained in:
parent
ae5412da5f
commit
13149724c6
2 changed files with 20 additions and 4 deletions
|
|
@ -92,16 +92,30 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #before-options v-if="creatable">
|
<template #before-options v-if="creatable">
|
||||||
<q-item clickable v-close-popup @click.stop="$emit('create')">
|
<q-item
|
||||||
|
:disable="creatableDisabled"
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click.stop="$emit('create')"
|
||||||
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<b class="row items-center">
|
<span class="row items-center">
|
||||||
<q-icon
|
<q-icon
|
||||||
name="mdi-plus-circle-outline"
|
name="mdi-plus-circle-outline"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
style="color: hsl(var(--positive-bg))"
|
style="color: hsl(var(--positive-bg))"
|
||||||
/>
|
/>
|
||||||
{{ $t('general.add', { text: $t('quotation.newCustomer') }) }}
|
<b>
|
||||||
</b>
|
{{ $t('general.add', { text: $t('quotation.newCustomer') }) }}
|
||||||
|
</b>
|
||||||
|
<span
|
||||||
|
v-if="creatableDisabled && creatableDisabledText"
|
||||||
|
class="app-text-muted q-pl-xs"
|
||||||
|
style="font-size: 80%"
|
||||||
|
>
|
||||||
|
{{ creatableDisabledText }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import { Ref, watch } from 'vue';
|
||||||
export type SelectProps<T extends (...args: any[]) => any> = {
|
export type SelectProps<T extends (...args: any[]) => any> = {
|
||||||
params?: Parameters<T>[0];
|
params?: Parameters<T>[0];
|
||||||
creatable?: boolean;
|
creatable?: boolean;
|
||||||
|
creatableDisabled?: boolean;
|
||||||
|
creatableDisabledText?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue