Code Monkey home page Code Monkey logo

wails-template-quasar-js's Issues

How to access wails runtime?

Hi @sgosiaco

Thanks for putting this together. I've just (yesterday) discovered Wails, but been using Quasar for a couple of years no, so this is fantastic.

I'm having problems using the wails runtime events though.

At the moment, my initial proof-of-concept page is:

<template>
  <q-page class="row items-center justify-evenly"> Dashboard </q-page>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';

onMounted(() => {
  try {
    window.runtime.EventsOn('test', function (data) {
      console.log('Timer', data);
    });
  } catch (err) {
    console.log('Error', err);
  }
});
</script>

But windows.runtime is undefined.

I've tried a few things to get round this:

First:
import * as runtime from "../../wailsjs/runtime/runtime"

This results in the EventsOn function failing with: Cannot read properties of undefined (reading 'EventsOnMultiple')

Second:
import than assign to windows:

window.runtime = runtime;```

This results in a recursive loop and maximum call stack reached.


Do you have an example of the runtime being available within Quasar? I've seen a vanilla vue project template as well, and that uses window.runtime but again I can't see any point where the runtime is specifically attached to the window.

Any help would be MUCH appreciated!

Regards,
Andy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.