file.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script>
  2. import { formatByte } from "utils";
  3. export default {
  4. name: "lemonMessageFile",
  5. inheritAttrs: false,
  6. render() {
  7. return (
  8. <lemon-message-basic
  9. class="lemon-message-file"
  10. props={{ ...this.$attrs }}
  11. scopedSlots={{
  12. content: props => [
  13. <div class="lemon-message-file__inner">
  14. <p class="lemon-message-file__name">{props.fileName}</p>
  15. <p class="lemon-message-file__byte">
  16. {formatByte(props.fileSize)}
  17. </p>
  18. </div>,
  19. <div class="lemon-message-file__sfx">
  20. <i class="lemon-icon-attah" />
  21. </div>
  22. ]
  23. }}
  24. />
  25. );
  26. }
  27. };
  28. </script>
  29. <style lang="stylus">
  30. @import '~styles/utils/index'
  31. +b(lemon-message-file)
  32. +b(lemon-message)
  33. +e(content)
  34. display flex
  35. cursor pointer
  36. width 200px
  37. background #fff
  38. padding 12px 18px
  39. overflow hidden
  40. p
  41. margin 0
  42. +e(tip)
  43. display none
  44. +e(inner)
  45. flex 1
  46. +e(name)
  47. font-size 14px
  48. +e(byte)
  49. font-size 12px
  50. color #aaa
  51. +e(sfx)
  52. display flex
  53. align-items center
  54. justify-content center
  55. font-weight bold
  56. user-select none
  57. font-size 34px
  58. color #ccc
  59. </style>