Commit 5517dd9b authored by Allen Bai's avatar Allen Bai

feat: 修改定位方式

parent 3f5da8d9
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"jsxBracketSameLine": true, "jsxBracketSameLine": true,
"arrowParens": "avoid", "arrowParens": "avoid",
"insertPragma": true, "insertPragma": true,
"tabWidth": 4, "tabWidth": 2,
"useTabs": false, "useTabs": false,
"bracketSpacing": true "bracketSpacing": true
} }
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>直接用script引入</title>
<style>
* {
margin: 0;
padding: 0;
}
html,
body {
background-color: rgb(35, 155, 86);
}
</style>
</head>
<body>
<div style="height: 200vh;border:5px slateblue solid"></div>
<script>
(function (e) {
const IPCFooterConfig = {}
function loadScript() {
var r = document.createElement("script");
(r.async = !0),
(r.src = "../../dist/IPCHelper.main.js"),
(r.crossOrigin = "anonymous"),
(r.onload = function () {
window.__TUIA_IPC_HELPER__ && window.__TUIA_IPC_HELPER__.mountIPCFooter(IPCFooterConfig)
}),
document.body && document.body.appendChild(r);
};
loadScript()
})(window);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>直接用script引入</title>
<style>
* {
margin: 0;
padding: 0;
}
html,
body {
background-color: rgb(35, 155, 86);
}
</style>
</head>
<body>
<script>
(function (e) {
const IPCFooterConfig = {}
function loadScript() {
var r = document.createElement("script");
(r.async = !0),
(r.src = "../../dist/IPCHelper.main.js"),
(r.crossOrigin = "anonymous"),
(r.onload = function () {
window.__TUIA_IPC_HELPER__ && window.__TUIA_IPC_HELPER__.mountIPCFooter(IPCFooterConfig)
}),
document.body && document.body.appendChild(r);
};
loadScript()
})(window);
</script>
</body>
</html>
...@@ -3,38 +3,46 @@ ...@@ -3,38 +3,46 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>直接用script引入</title> <title>直接用script引入</title>
<style> <style>
* { * {
margin: 0;
padding: 0; padding: 0;
margin: 0;
}
iframe {
border: 1px solid black;
display: block;
}
.box {
margin: 10px 20px;
}
.phone {
width: 375px;
height: 667px;
} }
html, .desk {
body { width: 1200px;
background-color: rgb(35, 155, 86); height: 600px;
} }
</style> </style>
</head> </head>
<body> <body>
<script> <div style="display: flex;justify-content: flex-start;align-items: center;flex-wrap: wrap;padding:30px;">
(function (e) { <div class="box">
const IPCFooterConfig = {} <h5>不带滚动的</h5>
function loadScript() { <iframe class="phone" src="./h5_without_scroll.html" frameborder="0"></iframe>
var r = document.createElement("script"); </div>
(r.async = !0), <div class="box">
(r.src = "../../dist/IPCHelper.main.js"), <h5>带滚动的</h5>
(r.crossOrigin = "anonymous"), <iframe class="phone" src="./h5_scroll.html" frameborder="0"></iframe>
(r.onload = function () { </div>
window.__TUIA_IPC_HELPER__ && window.__TUIA_IPC_HELPER__.mountIPCFooter(IPCFooterConfig) </div>
}),
document.body && document.body.appendChild(r);
};
loadScript()
})(window);
</script>
</body> </body>
</html> </html>
...@@ -22,7 +22,7 @@ function addStyles(ele: HTMLElement, styles: Optional<CSSStyleDeclaration> = {}) ...@@ -22,7 +22,7 @@ function addStyles(ele: HTMLElement, styles: Optional<CSSStyleDeclaration> = {})
const defaultFooterStyles: Optional<CSSStyleDeclaration> = { const defaultFooterStyles: Optional<CSSStyleDeclaration> = {
width: '100vw', width: '100vw',
position: 'absolute', position: 'fixed',
left: '0', left: '0',
right: '0', right: '0',
bottom: '0', bottom: '0',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment