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.
iot/projects/Platform/wwwroot/js/home/building.js

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;
});
}
}
});