mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 12:49:29 +08:00
now binds go code to window.backend
This commit is contained in:
parent
a44fd57e98
commit
a660e4a9da
File diff suppressed because one or more lines are too long
@ -1,9 +1,8 @@
|
||||
// Wails runtime JS
|
||||
|
||||
(function () {
|
||||
window.wails = window.wails || {
|
||||
$: {}
|
||||
};
|
||||
window.wails = window.wails || {};
|
||||
window.backend = {};
|
||||
|
||||
/****************** Utility Functions ************************/
|
||||
|
||||
@ -63,7 +62,7 @@
|
||||
|
||||
/************************* Bindings *************************/
|
||||
|
||||
var bindingsBasePath = window.wails.$;
|
||||
var bindingsBasePath = window.backend;
|
||||
|
||||
// Creates the path given in the bindings path
|
||||
function addBindingPath(pathSections) {
|
||||
@ -92,11 +91,14 @@
|
||||
function newBinding(bindingName) {
|
||||
|
||||
// Get all the sections of the binding
|
||||
var bindingSections = bindingName.split('.');
|
||||
var bindingSections = bindingName.split('.').splice(1);
|
||||
|
||||
// Get the actual function/method call name
|
||||
var callName = bindingSections.pop();
|
||||
|
||||
let pathToBinding;
|
||||
let err;
|
||||
|
||||
// Add path to binding
|
||||
[pathToBinding, err] = addBindingPath(bindingSections)
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
16
cmd/frameworks/bootstrap4lux/a_bootstrap4-packr.go
Normal file
16
cmd/frameworks/bootstrap4lux/a_bootstrap4-packr.go
Normal file
File diff suppressed because one or more lines are too long
@ -18,7 +18,7 @@ export default {
|
||||
methods: {
|
||||
getNewQuote: function() {
|
||||
var self = this;
|
||||
wails.$.main.QuotesCollection.GetQuote().then(result => {
|
||||
backend.QuotesCollection.GetQuote().then(result => {
|
||||
self.quote = result;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user