colmo设计师沙龙pc端后台管理系统

Line.vue 852B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <echarts :option="opt" :loading="loading"></echarts>
  3. </template>
  4. <script>
  5. export default {
  6. name: 'LineChart',
  7. components: {
  8. echarts: () => import('./index.vue')
  9. },
  10. props: {
  11. option: {
  12. type: Object,
  13. default: () => ({})
  14. },
  15. value: {
  16. type: Array,
  17. default: () => []
  18. },
  19. loading: Boolean
  20. },
  21. computed: {
  22. opt() {
  23. return {
  24. xAxis: {
  25. type: 'category',
  26. },
  27. yAxis: {
  28. type: 'value'
  29. },
  30. tooltip: {
  31. trigger: 'axis'
  32. },
  33. dataset: {
  34. dimensions: ['key', 'value'],
  35. source: this.value,
  36. },
  37. series: [
  38. {
  39. type: 'line',
  40. smooth: true
  41. }
  42. ],
  43. ...this.option,
  44. }
  45. }
  46. },
  47. data() {
  48. return {
  49. }
  50. }
  51. }
  52. </script>