You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
933 B
35 lines
933 B
var app = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
url: config.baseUrl + '/Home/BuildingData',
|
|
model: null,
|
|
events: ['OrganEntityInserted',
|
|
'OrganEntityUpdated',
|
|
'OrganEntityDeleted',
|
|
'BuildingEntityInserted',
|
|
'BuildingEntityUpdated',
|
|
'BuildingEntityDeleted']
|
|
};
|
|
},
|
|
mounted: function () {
|
|
app = this;
|
|
this.subscribe();
|
|
this.load();
|
|
},
|
|
beforeDestroy: function () {
|
|
PubSub.unsubscribes(this.events);
|
|
},
|
|
methods: {
|
|
subscribe: function () {
|
|
PubSub.subscribes(this.events, function (method, data) {
|
|
app.load();
|
|
});
|
|
},
|
|
load: function () {
|
|
axios.post(this.url).then(function (response) {
|
|
app.model = response.data;
|
|
});
|
|
}
|
|
}
|
|
}); |