1.0.2 • Published 10 months ago

vue-card-memory-game v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Vue Card Memory Game

A fun and interactive card memory game built with Vue and typescript.

Get Started

install the module via npm

npm i vue-card-memory-game@latest

Usage

import MemoryGame from 'vue-card-memory-game';
import 'vue-card-memory-game/dist/style.css';

<template>
  <div>
    <MemoryGame :cards :grid-size="6" />
  </div>
</template>

Structure of card object

type Card = {
    id: number;
    value: string;
    isOpen: boolean;
    isMatched: boolean;
    content: string;
}

Props

Prop NameTypeDefault ValueDescription
gridSizeNumber6The grid number. Must be an Integer number between 2 and 10
cardsArray[]array of data
cardHeightString400Card height
reverseClassesStringClasses for reversed side of card
allCardsAreMatchedFunction() => undefinedOptional callback triggered when the game is finished (all pairs found)

Slots

Prop NameDescription
reverseplace for card's reversed side
contentplace for card's content

License

MIT

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago