index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="bs-design-wrap bs-picture">
  3. <div class="content-box">
  4. <el-image
  5. :src="config.customize.url || noImageUrl"
  6. fit="fill"
  7. :style="{
  8. width: '100%',
  9. height: '100%',
  10. opacity: config.customize.opacity,
  11. borderRadius: config.customize.radius + 'px'
  12. }"
  13. draggable="false"
  14. >
  15. <div
  16. slot="placeholder"
  17. class="image-slot"
  18. >
  19. 加载中···
  20. </div>
  21. </el-image>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'PictureChart',
  28. components: {},
  29. props: {
  30. config: {
  31. type: Object,
  32. default: () => ({})
  33. }
  34. },
  35. data () {
  36. return {
  37. noImageUrl: require('data-room-ui/BasicComponents/Picture/images/noImage.png')
  38. }
  39. },
  40. computed: {},
  41. watch: {},
  42. mounted () {},
  43. methods: {
  44. // 由于静态组件没有混入公共函数,所以需要定义一个changeStyle方法,以免报错
  45. changeStyle () {
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .bs-design-wrap {
  52. width: 100%;
  53. background-color: rgba(0, 0, 0, 0);
  54. .content-box {
  55. width: 100%;
  56. height: 100%;
  57. }
  58. }
  59. </style>