blacklist.vue
859 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
44
<template>
<div class="blacklist-wrapper" :class="{'default': !hasBlacklist}">
<div v-if="hasBlacklist">
<blacklist-item
v-for="item in blacklist"
:key="item.userID"
:profile="item"
/>
</div>
<span style="color:gray" v-else>黑名单还是空的</span>
</div>
</template>
<script>
import BlacklistItem from './blacklist-item'
import { mapState } from 'vuex'
export default {
name: 'Blacklist',
components: {
BlacklistItem
},
computed: {
...mapState({
blacklist: state => state.blacklist.blacklist
}),
hasBlacklist() {
return this.blacklist.length > 0
}
}
}
</script>
<style lang="stylus" scoped>
.blacklist-wrapper {
padding: 12px;
overflow-y: scroll;
}
.default {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
</style>