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/IoTCenter/wwwroot/pages/iot/product.js

36 lines
1.2 KiB

function pages_iot_product() {
return Vue.component('pages_iot_product', function (resolve, reject) {
axios.get("/pages/iot/product.html").then(function (response) {
resolve({
template: response.data,
data() {
return {
url: '/IoTCenter/api/v1/product/getProduct?number=' + this.$route.query.number
};
},
mounted: function () {
axios.post(this.url)
.then(function (response) {
store.commit('setProduct', response.data);
$('title').text(response.data.name);
})
.catch(function (error) {
})
.finally(function () {
});
},
destroyed: function () {
store.commit('setProduct', null);
},
methods: {
},
computed: {
product: function () {
return store.state.product;
}
}
});
});
});
}