Blame view

ant-design-vue-jeecg/src/components/page/SHeaderNotice.vue 1.09 KB
肖超群 authored
1
2
3
4
5
6
7
8
9
10
11
12
13
<template>
  <a-popover trigger="click" placement="bottomRight" :overlayStyle="{ width: '300px' }">
    <template slot="content">
      <a-spin :spinning="loadding">
        <a-tabs>
          <a-tab-pane v-for="(tab, k) in tabs" :tab="tab.title" :key="k">

          </a-tab-pane>
        </a-tabs>
      </a-spin>
    </template>
    <span @click="fetchNotice" class="header-notice">
      <a-badge count="12">
肖超群 authored
14
        <a-icon style="font-size: 16px; padding: 4px" type="bell"/>
肖超群 authored
15
16
17
18
19
20
      </a-badge>
    </span>
  </a-popover>
</template>

<script>
肖超群 authored
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export default {
  name: "HeaderNotice",
  props: {
    tabs: {
      type: Array,
      default: null,
      required: true
    }
  },
  data() {
    return {
      loadding: false
    }
  },
  methods: {
    fetchNotice() {
      if (this.loadding) {
        this.loadding = false
        return
肖超群 authored
40
      }
肖超群 authored
41
42
43
44
      this.loadding = true
      setTimeout(() => {
        this.loadding = false
      }, 2000)
肖超群 authored
45
46
    }
  }
肖超群 authored
47
}
肖超群 authored
48
49
50
</script>

<style lang="less" scoped>
肖超群 authored
51
52
53
54
55
56
.header-notice {
  display: inline-block;
  transition: all 0.3s;

  span {
    vertical-align: initial;
肖超群 authored
57
  }
肖超群 authored
58
}
肖超群 authored
59
</style>