Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Frederick Bogdanoff
15,338 PointsHaving trouble displaying the back of new card.
Hey there. I'm currently having trouble displaying the back of a new card like in the tutorial. Currently the new card gets added. But I cannot display the back. Toggling the flipped property from false to true also doesn't have an effect unlike the original cards.
this is my vue instance
new Vue({
el: '#flashcard-app',
data: {
cards: cards,
newFront : '',
newBack : ''
},
methods: {
toggleCard: function(card){
card.flipped = !card.flipped;
},
addNew: function(){
this.cards.push({
front: this.newFront,
back: this.newFront,
flipped: false
});
}
}
});
3 Answers

Treasure Porth
Treehouse TeacherHey Frederick, it looks like in your Vue instance, you're setting both the front and the back of the card to this.newFront
. Make sure you're setting the back
property to this.newBack
:)

Frederick Bogdanoff
15,338 PointsHaha can't believe I missed this. Thank you

Frederick Bogdanoff
15,338 Pointsalright... Somewhat confusing.. I fiddled around by typing v-on:click="addNew()" and it worked. I even went back and changed it back to v-on:click="addNew" and it's still working like it should... I'm quite new to front end frameworks, is this unusual behaviour?

Jeffrey Ayling
12,524 PointsTreasure Porth's code didn't work for me either. My issue, I had to adjust from...
this.cards.push({
to...
cards.push({
...took me a while to figure out.
Frederick Bogdanoff
15,338 PointsFrederick Bogdanoff
15,338 PointsHere is my template `