chessboardjs icon indicating copy to clipboard operation
chessboardjs copied to clipboard

How to import chessboard.js in Vue App

Open Shivakumar-ZugZwang opened this issue 4 years ago • 4 comments

Hi I'm a beginner in Software Development

I have used chessboard.js in plain vanilla js but I'm not able to implement it in Vue.js can you help me out in integrating it even I tried npm install it but it was not working fine when I tried to resolve this issue I found it is not exported so we are not able to import it

can we get an update of npm or release any doc which helps to integrate chessboard.js in Vue

Shivakumar-ZugZwang avatar Nov 26 '21 00:11 Shivakumar-ZugZwang

~~Take a look at chessboardjs-vue.~~

Nevermind, this doesn't seem to be working. I just chose to use it via a CDN in the index.html file.

leo848 avatar Nov 21 '22 14:11 leo848

leo848: Can you show me the way to use it via CDN? Thank a lot

BaoAn21 avatar Mar 29 '23 15:03 BaoAn21

@BaoAn21

I now switched to chessground, an alternative that works much better imo (better API, a lot more useful functionality, is responsive on mobile while #74 etc. have not been resolved for a decade (!), and much more). You can use chessground via npm or another package manager, it is very easy in combination with Vue.

If you still want to use chessboard.js for whatever reason, you can look here and copy the snippets from "Content Delivery Network" into your index.html. You can then use window.Chessboard as you would in a normal, framework-free context. But I would still recommend switching to chessground for every app that's not just for throwaway use.

leo848 avatar Mar 30 '23 10:03 leo848

See also https://github.com/oakmac/chessboardjs/issues/157

It's a shame - I was drawn to this library because it is really well documented, but not being able to import is a hard blocker. I will try one of the chessground wrappers instead.

benjaminpjones avatar Jun 26 '23 00:06 benjaminpjones