game-card
game-card copied to clipboard
GET http://localhost:8081/images/<icon_name>.svg 404 (Not Found)
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
- Are you serving the files using polymer serve ? or a custom web server ?
- Which page are you loading ? index ? playground ?
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);
}
}