liuxiaolong
2019-05-06 3e0536f508aad49f743e7bfabca34e3980a1b6e2
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<template>
  <div class="select-bar-layout d-flex">
    <h5 class="mb-0 select-bar-s-title mr-2">已选:</h5>
    <div class="select-bar-s d-flex pr-2" v-for="(iteam,index) in data" :key="index">
      <div class="select-bar d-flex border" v-if="iteam.value">
        <h6 class="mb-0 title">{{iteam.title}}:</h6>
        <p class="mb-0 content" :title="iteam.value">{{iteam.value}}</p>
        <a class="close-btn" @click="$emit('to-clear',iteam)">
          <span class="ion ion-md-close "></span>
        </a>
      </div>
    </div>
    <a class="clearAll-btn px-2 text-danger" @click="$emit('to-clear-all')">
      清空筛选
    </a>
  </div>
</template>
<script>
export default {
  name: 'selectBar',
  props: {
    data: {
      type: Array,
      default: () => ([])
    }
  },
  data() {
    return {}
  },
  computed: {},
  methods: {},
  created() {},
  watch: {}
}
</script>
<style lang="scss" scoped>
.select-bar-layout {
  padding: 2px 5px;
  .select-bar-s-title {
    font-size: 14px;
    line-height: 26px;
  }
  .select-bar-s {
    .select-bar {
      // width: 200px;
      padding: 2px 5px 2px 10px;
      .title {
        line-height: 20px;
      }
      .content {
        padding: 0 5px;
        width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .close-btn {
        display: inline-block;
        vertical-align: middle;
        font-weight: 800;
        width: 20px;
        text-align: center;
        cursor: pointer;
        color: #ccc;
      }
      .close-btn:hover {
        color: #d9534f;
      }
    }
  }
  .clearAll-btn {
    line-height: 26px;
    cursor: pointer;
    text-decoration: underline;
  }
}
</style>