Golang WebAssembly Framework
App.go
type App struct {
Counter int
}
func (a App) OnTestClick() {
a.Counter++
coco.Set(a)
}
App.html
<div class="Test">
{{.Counter}}
</div>
App.css
.Test {
width: 160px;
}
go get github.com/mrmiguu/coco
You should use go-wasm-cli to run this example.
cd $GOPATH/src/github.com/mrmiguu/coco/example
go-wasm start