If my array of objects contains data, I want to display a button. In my Vuex store, I have defined an array like this:
state: {
document: []
},
I am adding data to this array from other components and I have confirmed that the data is being added correctly with no issues.
So the goal is to only show the button if there is data present:
<div class="row margin-above">
<div class="panel panel-primary" v-for="section in this.$store.getters.getDocument">
<div class="panel-body quote" >
<p>{{section.key}}</p>
</div>
</div>
<div v-if="this.$store.getters.getDocument != '[]'">
<button class="btn btn-success btn-block">Create Document</button>
</div>
</div>
The issue I'm facing is that the button always appears even when the condition should hide it. Any suggestions?