vitogit / vue-chessboard

Chessboard vue component to load positions, create positions and see threats
http://vitomd.com/vue-chessboard-examples/
GNU General Public License v3.0
165 stars 49 forks source link

A more generic approach to add options to the board #16

Closed vitogit closed 2 years ago

vitogit commented 4 years ago

chessground has a lot of options https://github.com/ornicar/chessground/blob/master/src/config.ts The idea is to wrap those options in a generic way so they are always available.

Some ideas 1) Add the options manually like currently we have the free option to move pieces anywhere <chessboard :free="true"/> For instance viewOnly, 2) Option to pass a config like this, the question is if we can pass also methods like the events.after.

  viewOnly: true,
  orientation: black,
  movable: {
    free: false
    showDests:false
    events: {
      after: ??
    };
  };
vitogit commented 2 years ago

This already can be done extending the component https://github.com/vitogit/vue-chessboard#extended-component-play-vs-random-ai