IframeFReportView.vue 871 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <iframe
  3. :id="id"
  4. :src="url"
  5. frameborder="0"
  6. width="100%"
  7. height="800px"
  8. scrolling="auto"
  9. style="background-color: #fff"
  10. ></iframe>
  11. </template>
  12. <script>
  13. import PageLayout from '../page/PageLayout'
  14. import RouteView from './RouteView'
  15. export default {
  16. name: 'IframePageContent',
  17. data() {
  18. return {
  19. url: '',
  20. id: '',
  21. }
  22. },
  23. created() {
  24. this.goUrl()
  25. },
  26. updated() {
  27. this.goUrl()
  28. },
  29. watch: {
  30. $route(to, from) {
  31. this.goUrl()
  32. },
  33. },
  34. methods: {
  35. goUrl() {
  36. let url = this.$route.meta.url
  37. let id = this.$route.path
  38. this.id = id
  39. //url = "http://www.baidu.com"
  40. console.log('------url------' + url)
  41. if (url !== null && url !== undefined) {
  42. this.url = url
  43. //window.open(this.url);
  44. }
  45. },
  46. },
  47. }
  48. </script>
  49. <style></style>