Frame.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <el-dialog :title='title' :visible.sync='dialogVisible' width='500px'>
  3. <iframe
  4. v-if='flag'
  5. id='google_ads_frame2'
  6. name='google_ads_frame2'
  7. frameborder='0'
  8. :src='iframeSrc'
  9. marginwidth='0'
  10. marginheight='0'
  11. vspace='0'
  12. hspace='0'
  13. allowtransparency='true'
  14. scrolling='no'
  15. allowfullscreen='true'
  16. ></iframe>
  17. </el-dialog>
  18. </template>
  19. <script>
  20. export default {
  21. name: 'saga-dialog',
  22. data() {
  23. return {
  24. dialogVisible: false,
  25. flag: true
  26. }
  27. },
  28. props: {
  29. iframeSrc: {
  30. default: ''
  31. },
  32. title: {
  33. default: '详情'
  34. }
  35. },
  36. methods: {
  37. show() {
  38. this.dialogVisible = true
  39. },
  40. refresh() {
  41. this.flag = this.flag ? false : true
  42. this.$nextTick(() => {
  43. this.flag = this.flag ? false : true
  44. })
  45. }
  46. },
  47. watch: {
  48. iframeSrc() {
  49. this.refresh()
  50. }
  51. }
  52. }
  53. </script>
  54. <style scoped lang='less'>
  55. #google_ads_frame2 {
  56. height: 350px;
  57. width: 100%;
  58. }
  59. </style>