[Vuejs]-Vue.js if statement with two variables

0👍

this.currentUser and question.author are not the same objects, even though they might contain the same data. This is why the comparison fails.

Your user objects probably have an id property (or some other primary key). Compare against that instead.

<input type="submit" v-if="this.currentUser.id === question.author.id" value="Löschen"/>

    Leave a comment