iconfont.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <el-row style="width: 100%">
  3. <el-col :span="option.span" v-for="(data,index) in option.data" :key="index">
  4. <div :style="{height: `${height}px`,
  5. minWidth:'200px',
  6. backgroundColor: 'rgb(245, 247, 249)',
  7. borderRadius: '5px',
  8. margin: '4px 5px',
  9. // boxShadow: '2px 2px 2px 2px rgba(0, 0, 0,0.3)'
  10. }">
  11. <!-- 图标内容 -->
  12. <div :style="{
  13. height: '100%',
  14. width:'50%',
  15. display: 'inline-block',
  16. float: 'left'
  17. }">
  18. <div :style="{
  19. width: `${height/3}px`,
  20. height: `${height/3}px`,
  21. margin: `${height/2 - height/3/2 - height/2/5}px`,
  22. lineHeight: `${height/3+height/2/5}px`,
  23. boxShadow: `0px 0px 5px 5px rgba(${data.color?data.color:'0,0,0'},0.3)`,
  24. textAlign: 'center',
  25. border:`${height/2/5}px solid rgb(${data.color?data.color:'0,0,0'})`,
  26. borderRadius: '50%',
  27. backgroundColor: `rgb(${data.color?data.color:'0,0,0'})`
  28. }">
  29. <i :class="data.icon" :style="{
  30. fontSize: `${height/3}px`,
  31. color: 'white',
  32. }"></i>
  33. </div>
  34. </div>
  35. <!-- 描述内容 -->
  36. <div :style="{
  37. height: '100%',
  38. width:'50%',
  39. display: 'inline-block',
  40. }">
  41. <h4 :style="{
  42. marginTop: `${(height/2-10)/2}px`,
  43. marginBottom: '10px',
  44. }">{{data.title}}</h4>
  45. <p :style="{
  46. color:'gary',
  47. margin: '10px 0',
  48. }">{{data.decimals?parseFloat(data.count).toFixed(2):data.count}}</p>
  49. </div>
  50. </div>
  51. </el-col>
  52. </el-row>
  53. </template>
  54. <script>
  55. export default {
  56. name: "iconfont",
  57. props:{
  58. option:{
  59. type: "Object",
  60. default: {}
  61. },
  62. height:{
  63. type:"Number",
  64. default: 80
  65. }
  66. }
  67. }
  68. </script>
  69. <style scoped>
  70. </style>