graceSpeaker.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template name="graceSpeaker">
  2. <view class="grace-swiper-msg">
  3. <view class="grace-swiper-msg-icon" :class="[iconClass]" :style="{color:iconColor}"></view>
  4. <swiper :vertical="vertical" autoplay="true" circular="true" :interval="interval" :style="{height:height}">
  5. <swiper-item v-for="(item, index) in msgs" :key="index" :style="{height:height}">
  6. <navigator
  7. :url="item.url" :open-type="item.opentype"
  8. :style="{fontSize:fontSize, fontWeight:fontWeight, color:fontColor, height:height, lineHeight:height}">{{item.title}}</navigator>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: "graceSpeaker",
  16. props: {
  17. msgs : {
  18. type : Array,
  19. default : function(){return [];}
  20. },
  21. iconClass : {
  22. type : String,
  23. default : ""
  24. },
  25. iconColor : {
  26. type : String,
  27. default : "#3688FF"
  28. },
  29. interval : {
  30. type : Number,
  31. default: 3000
  32. },
  33. vertical : {
  34. type : Boolean,
  35. default : true
  36. },
  37. fontSize : {
  38. type : String,
  39. default : "26rpx"
  40. },
  41. fontColor : {
  42. type : String,
  43. default : "#333333"
  44. },
  45. fontWeight : {
  46. type : String,
  47. default : ""
  48. },
  49. height:{
  50. type : String,
  51. default : "60rpx"
  52. }
  53. }
  54. }
  55. </script>
  56. <style scoped>
  57. .grace-swiper-msg{width:100%; display:flex; flex-wrap:nowrap; align-items:center;}
  58. .grace-swiper-msg-icon{margin-right:16rpx; display:inline-block; flex-shrink:0;}
  59. .grace-swiper-msg swiper{width:100%; height:60rpx; overflow:hidden;}
  60. .grace-swiper-msg swiper-item{overflow:hidden;}
  61. .grace-swiper-msg navigator{line-height:60rpx; overflow:hidden;}
  62. </style>