index.vue 851 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view class="U000008-template1" >
  3. <!-- style -->
  4. <view :style="wrapper_style"></view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: ['datas', 'styles'],
  10. data() {
  11. return{
  12. }
  13. },
  14. computed: {
  15. /** 样式 */
  16. wrapper_style() {
  17. if(this.datas.preview_color) {
  18. const {
  19. preview_color,
  20. search_height
  21. } = this.datas;
  22. return `
  23. height: ${search_height}px;
  24. background-color: ${preview_color.color};
  25. background-image: url(${preview_color.isColor == 2 ? preview_color.image : ''});
  26. background-size: 100% auto;
  27. bakcground-position: center;
  28. `;
  29. }
  30. },
  31. },
  32. methods: {
  33. },
  34. };
  35. </script>
  36. <style lang="less" scoped>
  37. // 默认
  38. .component-wrapper {
  39. width: 750rpx;
  40. }
  41. </style>