Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working example for hooks in browser #39

Open
bmacho opened this issue Nov 1, 2021 · 0 comments
Open

Working example for hooks in browser #39

bmacho opened this issue Nov 1, 2021 · 0 comments

Comments

@bmacho
Copy link

bmacho commented Nov 1, 2021

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/vue@2.6.14/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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant