product-list.vue
1.15 KB
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
44
<template>
<div class="title">
{{title}}
</div>
<div v-show="checkedList.length" class="product-list product-list-checked">
<pruduct v-for="product in list" v-if="product.checked" v-bind:product="product" v-bind:refund-data="refundData"></pruduct>
</div>
<div v-show="checkedList.length !== list.length" class="product-list">
<pruduct v-for="product in list" v-if="!product.checked" v-bind:product="product" v-bind:refund-data="refundData"></pruduct>
</div>
</template>
<script>
const pruduct = require('./product.vue');
module.exports = {
props: ['title', 'list', 'refundData'],
computed: {
checkedList() {
return this.list.filter(product => {
return product.checked;
});
}
},
components: {
pruduct
}
};
</script>
<style>
.title {
padding: 30px 30px 0;
color: #b0b0b0;
font-size: 28px;
line-height: 60px;
}
.product-list {
margin-top: -4px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
</style>