mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 01:43:15 +08:00
Initial Port
Updated templates
This commit is contained in:
parent
4742fd7ed2
commit
aa6b67734b
@ -10,8 +10,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
"text/template"
|
||||||
"github.com/alecthomas/template"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const templateSuffix = ".template"
|
const templateSuffix = ".template"
|
||||||
|
1
cmd/templates/basic/go.mod.template
Normal file
1
cmd/templates/basic/go.mod.template
Normal file
@ -0,0 +1 @@
|
|||||||
|
module {{.BinaryName}}
|
@ -4,7 +4,12 @@ import (
|
|||||||
wails "github.com/wailsapp/wails"
|
wails "github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
var html = `<h1> Basic Template </h1>`
|
var html = `
|
||||||
|
<div style='text-align:center'>
|
||||||
|
<h1> Basic Template </h1>
|
||||||
|
Welcome to your basic Wails app!
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
@ -12,7 +17,7 @@ func main() {
|
|||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
Height: 768,
|
Height: 768,
|
||||||
Title: "My Project",
|
Title: "{{.Name}}",
|
||||||
HTML: html,
|
HTML: html,
|
||||||
})
|
})
|
||||||
app.Run()
|
app.Run()
|
1
cmd/templates/custom/go.mod.template
Normal file
1
cmd/templates/custom/go.mod.template
Normal file
@ -0,0 +1 @@
|
|||||||
|
module {{.BinaryName}}
|
@ -4,7 +4,12 @@ import (
|
|||||||
wails "github.com/wailsapp/wails"
|
wails "github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
var html = `<h1> Custom Project </h1>`
|
var html = `
|
||||||
|
<div style='text-align:center'>
|
||||||
|
<h1> Custom </h1>
|
||||||
|
Welcome to your basic Wails app with added CSS!
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
@ -12,7 +17,7 @@ func main() {
|
|||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 800,
|
Width: 800,
|
||||||
Height: 600,
|
Height: 600,
|
||||||
Title: "My Project",
|
Title: "{{.Name}}",
|
||||||
HTML: html,
|
HTML: html,
|
||||||
})
|
})
|
||||||
app.Run()
|
app.Run()
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend",
|
"name": "{{.NPMProjectName}}",
|
||||||
|
"author": "{{.Author.Name}}<{{.Author.Email}}>",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
1
cmd/templates/vuewebpack/go.mod.template
Normal file
1
cmd/templates/vuewebpack/go.mod.template
Normal file
@ -0,0 +1 @@
|
|||||||
|
module {{.BinaryName}}
|
@ -12,7 +12,7 @@ func main() {
|
|||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
Height: 768,
|
Height: 768,
|
||||||
Title: "Vue Simple",
|
Title: "{{.Name}}",
|
||||||
JS: assets.String("app.js"),
|
JS: assets.String("app.js"),
|
||||||
CSS: assets.String("app.css"),
|
CSS: assets.String("app.css"),
|
||||||
})
|
})
|
@ -91,7 +91,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if frontend deps have been updated
|
// Check if frontend deps have been updated
|
||||||
buildSpinner.Start("Installing frontend dependencies...")
|
buildSpinner.Start("Installing frontend dependencies (This may take a while)...")
|
||||||
|
|
||||||
requiresNPMInstall := true
|
requiresNPMInstall := true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user