我增加了对iframe的支持,作者是否考虑加进去呢?
- Dominant language
- Vue
- Stars
- 16.3k
- Forks
- 4.7k
- PR merge metrics
- No merged PRs in 30d
Description
实现方式如下:
# 首先修改`/src/view/main/main.vue`
data 中增加定义:`iframes: []`,代码如下:

然后:
```
```
增加方法:
```
matchIframes () {
if (this.$route.meta.iframe) {
let name = this.$route.name
let currentFrame = _find(this.iframes, {name: name})
if(this.$route.meta.iframe && !currentFrame) {
this.iframes.push({
href: this.$route.meta.iframe,
name: name
})
}
}
},
```
> 我项目中使用了lodash,所以上面有`_find`,没用lodash的可直接用js原生方式去获取`currentFrame`。
# 最后在定义route的时候指定meta:
```
iframe: url
```
就ok了。如图:

**希望对大家的思路有帮助!**
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in /src/view/main/main.vue and review the existing router-view handling. Compare the proposed iframe list, route meta.iframe values, and iframe rendering behavior with the current routing setup. Done means iframe routes render correctly without breaking normal views, with the change integrated into the project rather than only applied locally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100