5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 17:52:29 +08:00

fix for rendering fragments via headless

This commit is contained in:
Lea Anthony 2019-01-15 08:34:32 +11:00
parent 60f34223b0
commit 6e0773b355
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -125,6 +125,13 @@ func (h *Headless) start(conn *websocket.Conn) {
h.injectCSS(h.frameworkCSS) h.injectCSS(h.frameworkCSS)
} }
var injectHTML string
if h.appConfig.isHTMLFragment {
injectHTML = fmt.Sprintf("$('#app').html('%s')", h.appConfig.HTML)
}
h.evalJS(injectHTML)
// Inject user CSS // Inject user CSS
if h.appConfig.CSS != "" { if h.appConfig.CSS != "" {
outputCSS := fmt.Sprintf("%.45s", h.appConfig.CSS) outputCSS := fmt.Sprintf("%.45s", h.appConfig.CSS)