SlyNoticeBar.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view :style="$getStyle(styles)">
  3. <u-notice-bar :list="list" :type="attrs['type']" :volume-icon="attrs['volume-icon']"
  4. :more-icon="attrs['more-icon']" :close-icon="attrs['close-icon']" :autoplay="attrs['autoplay']"
  5. :color="attrs['color']" :bg-color="attrs['bg-color']" :mode="attrs['mode']"
  6. :show="showNotice && attrs['show']" :volume-size="attrs['volume-size']" :font-size="attrs['font-size']"
  7. :duration="attrs['duration']" :speed="attrs['speed']" :is-circular="attrs['is-circular']"
  8. :play-state="attrs['play-state']" :border-radius="attrs['border-radius']"
  9. :no-list-hidden="attrs['no-list-hidden']" @close="onClose" @getMore="onMore" />
  10. </view>
  11. </template>
  12. <script>
  13. import Mixin from "../Mixin";
  14. const _this = this;
  15. export default {
  16. name: "SlyNoticeBar",
  17. mixins: [Mixin],
  18. data() {
  19. return {
  20. list: [],
  21. showNotice: true
  22. };
  23. },
  24. methods: {
  25. getList(arr) {
  26. this.list = arr.map(el => {
  27. return el.title
  28. });
  29. },
  30. onMore(e) {
  31. console.log('e = ', e)
  32. },
  33. onNetworkRequest() {
  34. }
  35. },
  36. watch: {
  37. dataLists: {
  38. handler: function(newList, oldList) {
  39. this.getList(newList || []);
  40. },
  41. deep: true,
  42. immediate: true
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. </style>