5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 03:59:59 +08:00

Merge pull request #16 from wailsapp/change-code-mount-point

now binds go code to window.backend
This commit is contained in:
Lea Anthony 2019-01-11 20:03:20 +11:00 committed by GitHub
commit ee355659ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,8 @@
// Wails runtime JS // Wails runtime JS
(function () { (function () {
window.wails = window.wails || { window.wails = window.wails || {};
$: {} window.backend = {};
};
/****************** Utility Functions ************************/ /****************** Utility Functions ************************/
@ -63,7 +62,7 @@
/************************* Bindings *************************/ /************************* Bindings *************************/
var bindingsBasePath = window.wails.$; var bindingsBasePath = window.backend;
// Creates the path given in the bindings path // Creates the path given in the bindings path
function addBindingPath(pathSections) { function addBindingPath(pathSections) {
@ -92,11 +91,14 @@
function newBinding(bindingName) { function newBinding(bindingName) {
// Get all the sections of the binding // Get all the sections of the binding
var bindingSections = bindingName.split('.'); var bindingSections = bindingName.split('.').splice(1);
// Get the actual function/method call name // Get the actual function/method call name
var callName = bindingSections.pop(); var callName = bindingSections.pop();
let pathToBinding;
let err;
// Add path to binding // Add path to binding
[pathToBinding, err] = addBindingPath(bindingSections) [pathToBinding, err] = addBindingPath(bindingSections)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@ export default {
methods: { methods: {
getNewQuote: function() { getNewQuote: function() {
var self = this; var self = this;
wails.$.main.QuotesCollection.GetQuote().then(result => { backend.QuotesCollection.GetQuote().then(result => {
self.quote = result; self.quote = result;
}); });
} }