NoticePanel.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="notice-panel">
  3. <div class="header">您有 {{data.length}} 条通知</div>
  4. <div class="notice-content">
  5. <div v-for="item in data" :key="item.key" class="notice-item">
  6. <span class="notice-icon">
  7. <li :class="item.icon"></li>
  8. </span>
  9. <span class="notice-cotent">
  10. {{ item.content }}
  11. </span>
  12. </div>
  13. </div>
  14. <div class="notice-footer">查看所有通知</div>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'NoticePanel',
  20. props: {
  21. data: {
  22. type: Array,
  23. default: () => [
  24. {
  25. key: "1",
  26. icon:'fa fa-envelope-o',
  27. content:'你修改了用户密码'
  28. },
  29. {
  30. key: "2",
  31. icon:'fa fa-music',
  32. content:'你修改了用户头像'
  33. },
  34. {
  35. key: "3",
  36. icon:'fa fa-edit',
  37. content:'今日25名新成员加入'
  38. },
  39. {
  40. key: "4",
  41. icon:'fa fa-edit',
  42. content:'您发表了一篇新随笔'
  43. }]
  44. }
  45. },
  46. data() {
  47. return {
  48. }
  49. },
  50. methods: {
  51. handleClick: function () {
  52. // 按钮操作处理函数
  53. this.$emit('click', {})
  54. }
  55. },
  56. mounted() {
  57. }
  58. }
  59. </script>
  60. <style scoped>
  61. .notice-panel {
  62. font-size: 15px;
  63. width: 250px;
  64. margin: -12px;
  65. }
  66. .header {
  67. padding-left: 10px;
  68. font-size: 14px;
  69. padding-top: 6px;
  70. padding-bottom: 6px;
  71. }
  72. .notice-content {
  73. font-size: 15px;
  74. }
  75. .notice-item {
  76. border-color: rgba(180, 190, 190, 0.8);
  77. border-top-width: 1px;
  78. border-top-style: solid;
  79. padding-top: 10px;
  80. padding-bottom: 10px;
  81. }
  82. .notice-item:hover {
  83. cursor: pointer;
  84. background: #b1a6a61e;
  85. }
  86. .notice-icon {
  87. padding-left: 10px;
  88. padding-right: 5px;
  89. }
  90. .notice-footer {
  91. font-size: 14px;
  92. text-align: center;
  93. padding-top: 10px;
  94. padding-bottom: 10px;
  95. border-color: rgba(180, 190, 190, 0.8);
  96. border-top-width: 1px;
  97. border-top-style: solid;
  98. }
  99. .notice-footer:hover {
  100. cursor: pointer;
  101. background: #b1a6a61e
  102. }
  103. </style>