vue-chessboard icon indicating copy to clipboard operation
vue-chessboard copied to clipboard

Working example for hooks in browser

Open bmacho opened this issue 3 years ago • 0 comments

Hey!

Can you provide a working example for hooks for the browser version?

I'm trying things like


<html>

	<head>
		<link rel="stylesheet" href="dist/vue-chessboard.css"/>
		<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
		<script src="dist/vue-chessboard.browser.js"></script>
	</head>

	<body>

		<div id="app">
			
		  <chessboard @onMove="showInfo"/> 
		  
		 <div>
				{{this.positionInfo}}
		</div>
		  
		</div>

		<script>
			
		var sI = function (data) {
			this.positionInfo = data
		}
		
		new Vue({
		  el: '#app',
		  components: {
			VueChessboard
		  },
		  data: {
		    showInfo: sI
		  }  
		  
		});
		</script>

	</body>

</html>

and variants, but nothing seems working, can't even pass a console.log or an alert.

Also, is there a list for available hooks?

Thank you,

bmacho avatar Nov 01 '21 13:11 bmacho