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
1.2 KiB
35 lines
1.2 KiB
function pages_iot_scenes() {
|
|
return Vue.component('pages_iot_scenes', function (resolve, reject) {
|
|
axios.get("/pages/iot/scenes.html").then(function (response) {
|
|
resolve({
|
|
template: response.data,
|
|
data() {
|
|
return {
|
|
title: "场景",
|
|
url: apiHost + '/IoTCenter/api/v1/Scene/GetScenes'
|
|
};
|
|
},
|
|
mounted: function () {
|
|
$('title').text(this.title);
|
|
axios.post(this.url)
|
|
.then(function (response) {
|
|
store.commit('setScenes', response.data);
|
|
})
|
|
.catch(function (error) {
|
|
})
|
|
.finally(function () {
|
|
|
|
});
|
|
},
|
|
destroyed: function () {
|
|
store.commit('setScenes', []);
|
|
},
|
|
computed: {
|
|
scenes: function () {
|
|
return store.state.scenes;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
} |