Skip to content

Commit

Permalink
fix: vanilla template for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
leaanthony committed Jul 3, 2020
1 parent 7106c33 commit c650671
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions cmd/templates/vanilla/frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

import 'core-js/stable';
const runtime = require('@wailsapp/runtime');

// We need to wait for runtime.Init to complete before
// running our JS
runtime.Init(() => {
// Main entry point
function start() {

// Ensure the default app div is 100% wide/high
var app = document.getElementById('app');
Expand All @@ -20,9 +19,12 @@ runtime.Init(() => {
`;

// Connect button to Go method
document.getElementById('button').onclick = () => {
window.backend.basic().then((result) => {
document.getElementById('button').onclick = function() {
window.backend.basic().then( function(result) {
document.getElementById('result').innerText = result;
})
}
});
});
};
};

// We provide our entrypoint as a callback for runtime.Init
runtime.Init(start);

0 comments on commit c650671

Please sign in to comment.