mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 22:13:36 +08:00
update basic templates to use a frontend dir
This commit is contained in:
parent
6880c53082
commit
579747d0f7
8
cmd/templates/basic/frontend/main.html
Normal file
8
cmd/templates/basic/frontend/main.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div style="text-align:center">
|
||||||
|
<div
|
||||||
|
class="wails-logo"
|
||||||
|
style="width: 25rem;margin: auto;height: 25rem;"
|
||||||
|
></div>
|
||||||
|
<h1>Basic Template</h1>
|
||||||
|
Welcome to your basic Wails app!
|
||||||
|
</div>
|
@ -1,25 +1,21 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gobuffalo/packr"
|
||||||
wails "github.com/wailsapp/wails"
|
wails "github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
var html = `
|
|
||||||
<div style='text-align:center'>
|
|
||||||
<div class="wails-logo" style="width: 25rem;margin: auto;height: 25rem;"></div>
|
|
||||||
<h1> Basic Template </h1>
|
|
||||||
Welcome to your basic Wails app!
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
// Assets
|
||||||
|
assets := packr.NewBox("./frontend")
|
||||||
|
|
||||||
// Initialise the app
|
// Initialise the app
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
Height: 768,
|
Height: 768,
|
||||||
Title: "{{.Name}}",
|
Title: "{{.Name}}",
|
||||||
HTML: html,
|
HTML: wails.BoxString(&assets, "main.html"),
|
||||||
})
|
})
|
||||||
app.Run()
|
app.Run()
|
||||||
}
|
}
|
||||||
|
8
cmd/templates/custom/frontend/main.html
Normal file
8
cmd/templates/custom/frontend/main.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div style="text-align:center">
|
||||||
|
<div
|
||||||
|
class="wails-logo"
|
||||||
|
style="width: 25rem;margin: auto;height: 25rem;"
|
||||||
|
></div>
|
||||||
|
<h1>Basic Template</h1>
|
||||||
|
Welcome to your basic Wails app!
|
||||||
|
</div>
|
@ -1,24 +1,21 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gobuffalo/packr"
|
||||||
wails "github.com/wailsapp/wails"
|
wails "github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
var html = `
|
|
||||||
<div style='text-align:center'>
|
|
||||||
<h1> Custom </h1>
|
|
||||||
Welcome to your basic Wails app with added CSS!
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
// Assets
|
||||||
|
assets := packr.NewBox("./frontend")
|
||||||
|
|
||||||
// Initialise the app
|
// Initialise the app
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 800,
|
Width: 1024,
|
||||||
Height: 600,
|
Height: 768,
|
||||||
Title: "{{.Name}}",
|
Title: "{{.Name}}",
|
||||||
HTML: html,
|
HTML: wails.BoxString(&assets, "main.html"),
|
||||||
})
|
})
|
||||||
app.Run()
|
app.Run()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user