Commit 3f5da8d9 authored by Allen Bai's avatar Allen Bai

feat: 添加测试脚本

parent 5f783bc0
root = true
[*]
charset = utf-8
indent_style = space # 缩进风格tab or space, 按tab键有2个缩进
indent_size = 2
end_of_line = lf
insert_final_newline = true #true时,确保文件末尾是新一行
trim_trailing_whitespace = true #是否删除行尾的空格
# 对后缀名为 md 的文件生效
[*.md]
trim_trailing_whitespace = false
<!-- @format -->
## 直接通过 script 引入 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>
......@@ -10,7 +10,8 @@
"watch": "rollup -c -w",
"build": "npm run clean && cross-env NODE_ENV=prod && rollup -c",
"build:debug": "npm run clean && cross-env NODE_ENV=dev rollup -c",
"clean": "rm -rf ./dist"
"clean": "rm -rf ./dist",
"test:in_html": "npm run watch & concurrently \"http-server -a localhost -p 1234\" \"open http://localhost:1234/example/inHTML/index.html\""
},
"typescript": ">=4.0",
"files": [
......@@ -30,10 +31,12 @@
"@typescript-eslint/parser": "^4.9.0",
"babel-eslint": "^10.1.0",
"chalk": "^4.1.0",
"concurrently": "^5.3.0",
"cross-env": "^7.0.3",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-prettier": "^3.2.0",
"http-server": "^0.12.3",
"husky": "^4.3.4",
"lint-staged": "^10.5.3",
"prettier": "^2.2.1",
......
......@@ -25,18 +25,22 @@ const defaultFooterStyles: Optional<CSSStyleDeclaration> = {
position: 'absolute',
left: '0',
right: '0',
bottom: '0'
bottom: '0',
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
}
const defaultBoardStyles: Optional<CSSStyleDeclaration> = {
display: 'inline-block',
textDecoration: 'none',
color: '#FFF',
backgroundColor: 'rgba(0,0,0,.4)',
margin: '8px auto',
height: '28px',
lineHeight: '28px',
padding: '0 10px',
borderRadius: '4px'
margin: '4px auto',
height: '22px',
lineHeight: '22px',
padding: '0 20px',
borderRadius: '4px',
fontSize: '12px'
}
async function mountIPCFooter(opts: IPCFooterOptions) {
......
This diff is collapsed.
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