Vue中使用iframe 、加载完成后回调事件

template:

script:

// vue生命周期钩子函数 -- 更新之后
updated() {
  if (this.$refs.iframe) {
    // IE
    if (this.$refs.iframe.attachEvent) {
      this.$refs.iframe.attachEvent('onload', () => {
        // 加载成功
        this.iLoading = false;
      });
    } else {
      this.$refs.iframe.onload = () => {
        // 加载成功
        this.iLoading = false;
      };
    }
  }
},

vue中iframe的 postMessage message的使用,以及一些小问题_snows_l的博客-CSDN博客icon-default.png?t=N5K3https://blog.csdn.net/snows_l/article/details/131532067?spm=1001.2014.3001.5501 

你可能感兴趣的:(js,前端开发,前端,javascript,html)