IframeDialog.vue 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="Iframe-dialog">
  3. <el-dialog
  4. :visible.sync="dialogVisible"
  5. width="50%"
  6. >
  7. <iframe :src="iframeSrc" width="100%" height="500" frameborder="0"></iframe>
  8. </el-dialog>
  9. </div>
  10. </template>
  11. <script>
  12. import { Dialog } from 'element-ui'
  13. export default {
  14. name: 'Iframe-dialog',
  15. components: {
  16. [Dialog.name]: Dialog
  17. },
  18. props: {
  19. showDialog: {
  20. type: Boolean,
  21. default: false
  22. },
  23. iframeSrc: {
  24. type: String,
  25. default: ''
  26. }
  27. },
  28. watch: {
  29. showDialog: {
  30. handler (newval) {
  31. this.dialogVisible = newval
  32. if (!newval) {
  33. this.getEmployInfo()
  34. }
  35. },
  36. immediate: true
  37. },
  38. dialogVisible (newval) {
  39. this.$emit('setDialogStatus', newval)
  40. }
  41. },
  42. data () {
  43. return {
  44. dialogVisible: false
  45. }
  46. },
  47. methods: {
  48. getEmployInfo () {
  49. this.$emit('getEmployInfo')
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .Iframe-dialog{}
  56. </style>