Comments (6)
Hi Sean,
Yes, I just noticed that browser with bound methods line. Excellent. Wails is really well written.
I'll take a look at that repo - thanks for sharing.
Andy
from wails-template-quasar-js.
I should add that in the dev console, runtime.js is being loaded ONLY if I import it, otherwise I can't see it.
from wails-template-quasar-js.
I've also just tried:
import { EventsOn } from '../../wailsjs/runtime/runtime';
onMounted(() => {
try {
EventsOn('test', function (data) {
console.log('Timer', data);
});
} catch (err) {
console.log('Error', err);
}
});
But again get "Cannot read properties of undefined (reading 'EventsOnMultiple')"
from wails-template-quasar-js.
Ignore me! I'm a complete doofus.
I was running the app in my browser, which obviously doesn't have access to the go runtime.
Doh!
from wails-template-quasar-js.
Ah glad you were able to figure it out.
For future reference, there's that other url/port that gets printed when you run wails dev
that looks like this
To develop in the browser and call your bound Go methods from Javascript, navigate to: http://localhost:34115
If you go to that specific url you will have access to the go runtime
from wails-template-quasar-js.
And here's an example repo as well if you want to see how I'd use the events between go and JS.
This example sets up a simple goroutine to send over an event every second and the JS part just updates a ref which is shown in the app.
sgosiaco/wails-quasar-events-example@e3b8d06
from wails-template-quasar-js.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wails-template-quasar-js.