Permalink
Browse files

Convert autofill component to an invoice-specific instance

  • Loading branch information...
lovett committed Dec 28, 2016
1 parent c620d96 commit 44b28e41692407d9a27febd9ec7c9b9abbbe86cc
View
@@ -16,6 +16,7 @@
"laravel-elixir": "6.0.0-15",
"select2": "4.0.3",
"select2-bootstrap-theme": "0.1.0-beta.9",
"vue": "2.1.6"
"vue": "2.1.6",
"vue-resource": "^1.0.3"
}
}
@@ -0,0 +1,30 @@
/* global Vue */
new Vue({
el: '.invoice-form',
props: {
},
data: {},
created: function () {
self = this;
vueBus.$on('menu-changed', function (e) {
var params = {
projectId: e.target.value,
limit: 1
}
self.fetch(params);
});
},
methods: {
fetch: function (params) {
var resource = this.$resource('/invoice');
resource.query(params).then((response) => {
console.log(response);
}, (response) => {
console.warn(response);
});
}
}
});
View
@@ -1,20 +0,0 @@
/* global Vue */
Vue.component('autofill', {
template: '<div>hello</div>',
props: {
},
data: function () {
return {
}
},
created: function () {
vueBus.$on('menu-changed', function (e) {
console.log(e.target.value);
});
},
methods: {
}
});
Oops, something went wrong.

0 comments on commit 44b28e4

Please sign in to comment.