vpusher / game-card

playing game card element based on ES6 and Polymer 2.0
MIT License
41 stars 11 forks source link

GET http://localhost:8081/images/<icon_name>.svg 404 (Not Found) #8

Open malkomich opened 7 years ago

malkomich commented 7 years ago

It tries to find in a local project's folder called images, instead of searching it in the folder of this component.

https://github.com/vpusher/game-card/blob/eae8568912ed85baa86e577fc5f329fbeeee43a5/game-card.html#L368

The icons are successfully loaded, but it first throw multiple exceptions like this.

vpusher commented 7 years ago

@malkomich

malkomich commented 7 years ago

I am using the component in a Vuejs + Webpack application.

I'm just using it like this:

<game-card :symbol="card.symbol" :rank="card.rank" :flippable="card.flippable" :unrevealed="!card.revealed"
              v-on:click="playRound(card)"></game-card>

in a loop with a preloaded array of cards:

export default class GameCard {

  static CLUBS = '♣';
  static DIAMONDS = '♦';
  static HEARTS = '♥';
  static SPADES = '♠';

  static RANKS = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'j', 'q', 'k', 'a'];

  constructor(symbol, rank, revealed = true, flippable = true) {
    this.symbol = symbol;
    this.rank = rank;
    this.revealed = revealed;
    this.flippable = flippable;
  }

  toggleFlippable(flippable) {
    this.flippable = flippable;
  }

  get key() {
    return ''.concat(this.rank).concat(this.symbol);
  }
}