(account) disable add user button if empty

This commit is contained in:
Julien Calixte
2020-04-11 14:26:58 +02:00
parent 972f7224d6
commit fd2c046c2c

View File

@@ -1,6 +1,12 @@
<template>
<div class="account-user-new">
<h3 v-if="showTitle" class="subtitle is-3">{{ $tc('account.friends', localeUsers.length, { count: localeUsers.length }) }}</h3>
<h3 v-if="showTitle" class="subtitle is-3">
{{
$tc('account.friends', localeUsers.length, {
count: localeUsers.length
})
}}
</h3>
<user-new v-if="user && defaultUser" v-model="user" />
<div v-for="(user, k) in localeUsers" :key="k">
<user-new v-model="localeUsers[k]" @remove="() => remove(k)" />
@@ -17,7 +23,14 @@
/>
</div>
<div class="control">
<button type="button" class="button is-primary" @click.prevent="newUser">ajouter</button>
<button
type="button"
class="button is-primary"
:disabled="!newUserId"
@click.prevent="newUser"
>
ajouter
</button>
</div>
</div>
</div>