index.vue 861 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <!-- 视频组 -->
  3. <view class="diy-video"
  4. :style="{ padding: `${itemStyle.paddingTop * 2}rpx ${itemStyle.paddingLeft * 2}rpx`, background: itemStyle.background }">
  5. <video class="video" :style="{ height: `${itemStyle.height * 2}rpx` }" :src="params.videoUrl" :poster="params.poster"
  6. :autoplay="params.autoplay == 1" controls></video>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'Videos',
  12. /**
  13. * 组件的属性列表
  14. * 用于组件自定义设置
  15. */
  16. props: {
  17. itemIndex: String,
  18. itemStyle: Object,
  19. params: Object
  20. },
  21. /**
  22. * 组件的方法列表
  23. * 更新属性和数据的方法与更新页面数据的方法类似
  24. */
  25. methods: {
  26. }
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .diy-video .video {
  31. width: 100%;
  32. display: block;
  33. }
  34. </style>