game-card icon indicating copy to clipboard operation
game-card copied to clipboard

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

Open malkomich opened this issue 8 years ago • 2 comments

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.

malkomich avatar Aug 22 '17 18:08 malkomich

@malkomich

  • Are you serving the files using polymer serve ? or a custom web server ?
  • Which page are you loading ? index ? playground ?

vpusher avatar Sep 05 '17 21:09 vpusher

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);
  }
}

malkomich avatar Sep 09 '17 16:09 malkomich