Comments (6)
两张图看上去没有区别啊,全屏对象是什么,使用的是组件还是指令模式?
最好能提供复现的简单示例。
参考 https://codepen.io/mirari/pen/VwjyKPL
from vue-fullscreen.
不好意思,不好意思,图贴错了,2张都贴的是未全屏的。(感谢作者查看)
上面图片更新了,全屏时 iframe 中的 body 元素中内容为空了
全屏对象:是元素中 document中类名为 document-wrapper 这个元素。
使用方式:指令模式
两张图看上去没有区别啊,全屏对象是什么,使用的是组件还是指令模式? 最好能提供复现的简单示例。 参考 https://codepen.io/mirari/pen/VwjyKPL
from vue-fullscreen.
如果iframe是一个独立页面,全屏切换应该是没问题的
https://codepen.io/mirari/pen/oNGLwBa
但是,这里有一个无法避免的问题是iframe在DOM中被移动时会导致重新加载,目前看上去是无解的。https://stackoverflow.com/questions/8318264/how-to-move-an-iframe-in-the-dom-without-losing-its-state
teleport的实现原理是触发全屏时将它移动到body根节点下,并将body全屏,从而避免一些动态创建的弹窗无法被看到的问题。
这个过程中被全屏的元素如果含有iframe,就无法避免被重新加载。
看上去这个iframe是动态创建的,这可能就需要一个重新初始化的动作来还原它被创建的整个过程。
可以在callback回调里做这个操作。
from vue-fullscreen.
是的,估计是重新加载的原因。
但是我试过在callback中重新initTinymce并没有效果。
我添加了一个demo,链接为:https://github.com/DanPeony007/vue-fullscreen-issue-demo
首页就可以复现这个问题,大神有空可以看一下。
非常感谢~~
from vue-fullscreen.
我试了下在callback里执行是有效的
应该是tinymce自己不支持重复init,需要先销毁
fullscreenChange(fullscreen) {
this.fullscreen = fullscreen
this.$refs.tinymce.destroyTinymce()
this.$refs.tinymce.initTinymce()
}
但是这样其实仍然有问题,如果用户已经编辑过内容,销毁重建会丢失数据。
另一个思路是不使用teleport,全屏目标是body,然后在回调中为你的目标元素添加一个样式,用绝对定位的形式将其撑满屏幕。这样既不会影响弹出框,也不会触发iframe刷新。
from vue-fullscreen.
非常感谢作者的耐心解答。
我试过,第一种方式确实可以,先销毁再重建。
但是还是有一些担心,会影响到数据一致性(有编辑页面全屏演示)。最终决定使用你推荐的这个思路,不使用teleport,将body全屏,目标元素定位。
非常感谢~
from vue-fullscreen.
Related Issues (20)
- TypeError: this.$refs.fullscreen.toggle is not a function HOT 7
- 建议把点击就退出的功能在option中加一个开关 HOT 2
- Compile vue-fullscreen with application HOT 6
- iPhone Full Screen doesnot work HOT 2
- Compatibility with Jest HOT 2
- Are there plans to support VUE3 HOT 9
- window.onscroll does not work in fullscreen mode HOT 1
- 全屏下的input聚焦输入时会退出全屏怎么处理 HOT 2
- Failed when publish HOT 1
- antv x6的拖拽wrapper和 elementui 的message弹框依旧会被盖住哦 HOT 3
- Component does not destroy its childrem when Unmount HOT 1
- vue 转 app 返回时会退出全屏 HOT 1
- Retain fullscreen on redirect HOT 2
- Failed to execute 'insertBefore' on 'Node': The new child element contains the parent HOT 2
- Do not work on iOS HOT 1
- 如何快速给element-ui的组件添加右上角全屏显示图标按钮和功能?
- Feature request: exit manually HOT 12
- vue3注册插件时报错 HOT 2
- Vue3.main.js 组件注册,抛出error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-fullscreen.