1 Star 0 Fork 1

归位 / webview

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 715 Bytes
一键复制 编辑 原始数据 按行查看 历史
Serge A. Zaitsev 提交于 2017-11-28 18:35 . example: use InjectCSS
package main
import (
"github.com/zserge/webview"
)
// Counter is a simple example of automatic Go-to-JS data binding
type Counter struct {
Value int `json:"value"`
}
// Add increases the value of a counter by n
func (c *Counter) Add(n int) {
c.Value = c.Value + int(n)
}
// Reset sets the value of a counter back to zero
func (c *Counter) Reset() {
c.Value = 0
}
func main() {
w := webview.New(webview.Settings{
Title: "Click counter: " + uiFrameworkName,
})
defer w.Exit()
w.Dispatch(func() {
// Inject controller
w.Bind("counter", &Counter{})
// Inject CSS
w.InjectCSS(string(MustAsset("js/styles.css")))
// Inject web UI framework and app UI code
loadUIFramework(w)
})
w.Run()
}
1
https://gitee.com/jicg/webview.git
git@gitee.com:jicg/webview.git
jicg
webview
webview
9c1b0a888aa4

搜索帮助

53164aa7 5694891 3bd8fe86 5694891