atme.vue 883 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div class="at-me" v-show="atList.length">
  3. <div class="at-me-item" v-if="atList.length >= 2 && totalVisible" @click="scrollToMsg">
  4. <div class="at-content">有{{atList.length}}个人提到了你</div>
  5. <i class="icon-clise" title="关闭" @click.stop="totalVisible = false"></i>
  6. </div>
  7. <div class="at-me-item" v-if="itemVisible" @click="scrollToMsg">
  8. <div class="at-content">{{atList[0].name}}提到了你</div>
  9. <i class="icon-clise" title="关闭" @click.stop="itemVisible = false"></i>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'atMe',
  16. props: {
  17. atList: [Array]
  18. },
  19. data () {
  20. return {
  21. totalVisible: true,
  22. itemVisible: true
  23. }
  24. },
  25. methods: {
  26. scrollToMsg () {
  27. this.emit('scrollToMsg', 0)
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. </style>