edb751306f76c990257b63d2d5ad7de2c5018132.svn-base 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <a-popover trigger="click" placement="bottomRight" :overlayStyle="{ width: '300px' }">
  3. <template slot="content">
  4. <a-spin :spinning="loadding">
  5. <a-tabs>
  6. <a-tab-pane v-for="(tab, k) in tabs" :tab="tab.title" :key="k">
  7. </a-tab-pane>
  8. </a-tabs>
  9. </a-spin>
  10. </template>
  11. <span @click="fetchNotice" class="header-notice">
  12. <a-badge count="12">
  13. <a-icon style="font-size: 16px; padding: 4px" type="bell" />
  14. </a-badge>
  15. </span>
  16. </a-popover>
  17. </template>
  18. <script>
  19. export default {
  20. name: "HeaderNotice",
  21. props: {
  22. tabs: {
  23. type: Array,
  24. default: null,
  25. required: true
  26. }
  27. },
  28. data () {
  29. return {
  30. loadding: false
  31. }
  32. },
  33. methods: {
  34. fetchNotice () {
  35. if (this.loadding) {
  36. this.loadding = false
  37. return
  38. }
  39. this.loadding = true
  40. setTimeout(() => {
  41. this.loadding = false
  42. }, 2000)
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="less" scoped>
  48. .header-notice{
  49. display: inline-block;
  50. transition: all 0.3s;
  51. span {
  52. vertical-align: initial;
  53. }
  54. }
  55. </style>