ad-custom-view.vue 607 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view :style="{display: isShow ? 'block' : 'none'}">
  3. <ad-custom :unit-id="unitId" :ad-intervals="adIntervals" @error="onerror" @load="onload"></ad-custom>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name:"ad-custom-view",
  9. props: {
  10. // 广告id
  11. unitId: {
  12. type: String,
  13. default: ""
  14. },
  15. // 广告自动刷新时间
  16. adIntervals: {
  17. type: String,
  18. default: '100'
  19. }
  20. },
  21. data() {
  22. return {
  23. isShow: true
  24. };
  25. },
  26. methods: {
  27. onload(e) {
  28. this.isShow = true
  29. },
  30. onerror(e) {
  31. this.isShow = false
  32. }
  33. }
  34. }
  35. </script>
  36. <style>
  37. </style>