goods.vue
982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<template>
<div class="goods">
<product-list v-bind:data="productList"></product-list>
</div>
</template>
<script>
const titleFloor = require('component/resources/title-floor.vue');
const productList = require('product/list.vue');
module.exports = {
data() {
return {
productList: []
};
},
props: ['floor'],
components: {
titleFloor: titleFloor,
productList
},
created() {
let productSkn = [];
this.floor.forEach(item => {
productSkn.push(item.id);
});
$.ajax({
url: '/channel/goods.json',
data: {
productSkn: productSkn.join(',')
}
}).then(result => {
console.log(result);
this.productList = result;
});
}
};
</script>
<style>
</style>