|
本帖最后由 liuyun 于 2024-9-25 21:28 编辑
其实不是解决无法缩放问题,而是能让整个页面能左右滑动了
通过ssh进入root权限,
进入 /usr/trim/www 目录找到index.thml
在最后一个script标签,将以下内容粘贴在后面就可以了。移动端刷新页面就能看到效果。
- <script>
- // 定义一个回调函数,用于处理 DOM 变化
- function callback(mutationsList, observer) {
- for (const mutation of mutationsList) {
- if (mutation.type === "childList") {
- if (mutation.addedNodes.length > 0) {
- mutation.addedNodes[0].style.minWidth = "1024px";
- }
- }
- }
- }
- // 创建一个 MutationObserver 实例
- const observer = new MutationObserver(callback);
- // 配置观察选项
- const config = { childList: true };
- const root = document.getElementById("root");
- root.style.width = "100%";
- root.style.overflowX = "auto";
- // 开始观察目标元素
- observer.observe(root, config);
- </script>
复制代码 已知问题:
- 打开的应用框还是无法拖动
|
|