Vue iFrames与Vue路由器

Vue iFrames with Vue Router

本文关键字:Vue 路由器 iFrames      更新时间:2023-09-26

不确定我是做错了什么,还是这是一个错误,

我有一个运行vue路由器的简单网页vue.js,主页上有一个iframe。在页面上没有iframe的情况下,使用v-link在页面之间移动时效果良好,但有了iframe,我在尝试在页面之间进行移动时会出现跨域错误。

vue.common.js?e881:1140 Uncaught SecurityError: Blocked a frame with origin "http://localhost:8080" from accessing a frame with origin "http://interactr-dev.s3-website-eu-west-1.amazonaws.com". Protocols, domains, and ports must match.

我不确定这是否与此有关,但iframe也在运行Vue(不过它们不绑定在同一个id上)。

有人不知道这是Vue的错误还是我的错误吗?

Vue v1.0.24修复了iframes的一个问题(感谢@Yerko)。这个问题的作者提到,更新到更高版本解决了这个问题。