Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否支持直接在router配置js中配置iframetab的信息,从而在菜单连接中直接点击打开一个iframe tab #59

Closed
sleiphur opened this issue Jun 5, 2020 · 4 comments
Labels
feature New feature or request

Comments

@sleiphur
Copy link

sleiphur commented Jun 5, 2020

先赞一下,很好用的tab组件。

然后想请问一下,现在是否支持直接在router配置中配一个访问iframe的tab定义?

看了文档和demo,是通过routerTab.openIframe这个方法来打开一个iframe的tab。

还请指导。

@sleiphur sleiphur added the feature New feature or request label Jun 5, 2020
@bhuh12
Copy link
Owner

bhuh12 commented Jun 5, 2020

https://github.com/bhuh12/vue-router-tab/blob/master/lib/util/routes.js

这个是注入的 iframe 页签路由配置,路由相对 RouterTab 父路由

你可以这样拼接路由地址以访问 iframe 页签。
title 和 icon 不是必需的
注意: 链接的参数需要 encodeURIComponent 编码处理

path: 'iframe/:src/:title?/:icon?'

@sleiphur
Copy link
Author

sleiphur commented Jun 6, 2020

谢谢您的指导,现在我已经可以成功从左侧menu中打开一个iframe页面了。
打开的iframe页面,高度没有撑满整个区域,查了一下,似乎是有个min-height:300px;在作用,有没有什么方法,可以使得这个页面撑满100%的高度呢?就像demo中用routerTab.openIframe这个方法打开的tab页,就可以撑满整个高度。
jietu

@bhuh12
Copy link
Owner

bhuh12 commented Jun 6, 2020

这个需要你自己调整 RouterTab 的样式以适应你页面的布局。
RouterTab 采用 flex 布局来控制内部内容,添加 min-height 是为了在默认无外部样式是情况下也能展示页面内容。

@sleiphur
Copy link
Author

sleiphur commented Jun 6, 2020

谢谢,明白了,在应用中增加了height的css,效果也达成了。

@sleiphur sleiphur closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants