zpzgiser
2021-07-18 e00cf26e79ea6c36a64331f793c7c8db70cd0a62
src/components/iframe/main.vue
@@ -1,8 +1,6 @@
<template>
  <basic-container>
    <iframe :src="src"
            class="iframe"
            ref="iframe"></iframe>
    <iframe :src="src" class="iframe" ref="iframe"></iframe>
  </basic-container>
</template>
@@ -14,7 +12,7 @@
    name: "AvueIframe",
    data() {
      return {
        urlPath: this.getUrlPath() //iframe src 路径
      urlPath: this.getUrlPath(), //iframe src 路径
      };
    },
    created() {
@@ -32,7 +30,7 @@
      routerPath: function () {
        // 监听routerPath变化,改变src路径
        this.urlPath = this.getUrlPath();
      }
    },
    },
    computed: {
      ...mapGetters(["screen"]),
@@ -40,7 +38,7 @@
        return this.$route.query.src
          ? this.$route.query.src.replace("$", "#")
          : this.urlPath;
      }
    },
    },
    methods: {
      // 显示等待框
@@ -61,7 +59,10 @@
      load() {
        this.show();
        var flag = true; //URL是否包含问号
        if (this.$route.query.src !== undefined && this.$route.query.src.indexOf("?") === -1) {
      if (
        this.$route.query.src !== undefined &&
        this.$route.query.src.indexOf("?") === -1
      ) {
          flag = false;
        }
        var list = [];
@@ -113,8 +114,8 @@
        let url = window.location.href;
        url = url.replace("/myiframe", "");
        return url;
      }
    }
    },
  },
  };
</script>