wailsapp / todo

Example Wails application - the famous todo app!
22 stars 8 forks source link

Vue "this" issue #2

Open bshorrosh opened 4 years ago

bshorrosh commented 4 years ago

Suggest to update the mounted code to include the following, which fixes the "this" reference inside Wails.Events...

mounted() { let that = this Wails.Events.On("filemodified", () => { that.loadList(); }); Wails.Events.On("error", (message, number) => { let result = number * 2; that.setErrorMessage(${message}: ${result}); }); // Load the list at the start that.loadList(); }

leaanthony commented 3 years ago

Happy to accept a PR!