Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
deebloo committed Feb 15, 2024
1 parent 0ddb673 commit 8a82778
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ The go-board element can display a game from a sgf file. You can display a game
></go-board>
```

`go-board` can also be used as a form element. It will submit the game key of the current board. This can can be parsed to set the board state manually.
Being form associated also means that you can send data to your own servers without writing any JavaScript.

```html
<form action="/save-game">
<go-board name="game">
<go-stone color="black" slot="R17"></go-stone>
<go-stone color="white" slot="R18"></go-stone>
<go-stone color="black" slot="Q18"></go-stone>
</go-board>
</form>
```

Attributes

| Item | description |
Expand Down
2 changes: 1 addition & 1 deletion dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
</style>

<form>
<form action="/save-game">
<button>submit</button>
<go-board name="board"></go-board>
</form>
Expand Down

0 comments on commit 8a82778

Please sign in to comment.