index.vue 832B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <div class="dashboardList">
  3. <ul class="flex-h">
  4. <li class="flex-item">
  5. <div :style="{background:colorList[index%colorList.length]}">
  6. <div class="centerLabel">
  7. <span>{{data.title}}</span>
  8. <span>{{data.value}}</span>
  9. </div>
  10. </div>
  11. </li>
  12. </ul>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: '',
  18. props: ['data'],
  19. data () {
  20. return {
  21. colorList: ['#fc6243', '#409EFF', '#4ddea2', '#f6e259', '#5c59f6', '#f66f59'],
  22. }
  23. },
  24. mounted () {
  25. this.$nextTick(function () {
  26. console.log(JSON.stringify(this.data))
  27. })
  28. },
  29. methods: {
  30. }
  31. }
  32. </script>
  33. <!-- Add "scoped" attribute to limit CSS to this component only -->
  34. <style lang="scss" scoped>
  35. @import "page.scss";
  36. </style>