[Vuejs]-Concatenating vue API URL

0👍

According to your demo code,

addCard: function(cardName) {
      this.deck.push(cardName);
      this.card = '';
    },

I think you get confused, the cardName was inserted to deck by event rather than card,
and you set an empty string with this.card which means the card is empty on next line, so you can’t get any string once you apply addCard.

please try to use url: apiLink + this.deck[0], to replace url: apiLink + this.card,

Leave a comment