Define accountCount internally instead of as a props

This commit is contained in:
Bubka
2020-11-21 19:41:36 +01:00
parent 1864378c74
commit b4ce39e9d5
4 changed files with 26 additions and 5 deletions

View File

@@ -45,7 +45,7 @@
</div>
</div>
<!-- Footer -->
<vue-footer :showButtons="true">
<vue-footer :showButtons="true" v-if="accountCount > 0">
<!-- back button -->
<p class="control">
<router-link class="button is-dark is-rounded" :to="{ name: 'accounts' }" >
@@ -109,6 +109,7 @@
data(){
return {
accountCount: null,
form: new Form({
qrcode: null,
uri: '',
@@ -121,7 +122,14 @@
}
},
props: ['accountCount'],
// props: ['accountCount'],
mounted() {
this.axios.get('api/twofaccounts/count').then(response => {
this.accountCount = response.data.count
})
},
created() {