wails-template-vue/app.tmpl.go

37 lines
713 B
Go
Raw Normal View History

2021-09-08 08:58:58 +08:00
package main
import (
"context"
"fmt"
)
// App struct
type App struct {
runtime context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// startup is called at application startup
func (b *App) startup(ctx context.Context) {
// Perform your setup here
//TODO: move to new runtime layout
//b.runtime = runtime
//runtime.Window.SetTitle("{{.ProjectName}}")
}
// shutdown is called at application termination
2021-09-09 05:17:10 +08:00
// 在应用程序终止时被调用
2021-09-08 08:58:58 +08:00
func (b *App) shutdown(ctx context.Context) {
// Perform your teardown here
}
// Greet returns a greeting for the given name
func (b *App) Greet(name string) string {
return fmt.Sprintf("Hello %s!", name)
}