7 changed files with 70 additions and 23 deletions
@ -1,6 +1,31 @@ |
|||||
# 有源标靶上位机软件 |
# 有源标靶上位机软件 |
||||
|
|
||||
## 快速开始 |
## 快速开始 |
||||
|
|
||||
### 安装 |
### 安装 |
||||
|
|
||||
1. 克隆仓库 |
1. 克隆仓库 |
||||
|
|
||||
|
```bash |
||||
|
git clone https://gitea.anxinyun.cn/qinjian/FlexometerSetup.git |
||||
|
``` |
||||
|
|
||||
|
2. 安装依赖 |
||||
|
|
||||
|
```bash |
||||
|
cd FlexometerSetup |
||||
|
npm install |
||||
|
``` |
||||
|
|
||||
|
3. 开发 |
||||
|
|
||||
|
```bash |
||||
|
npm run dev |
||||
|
``` |
||||
|
|
||||
|
4. 打包应用 |
||||
|
|
||||
|
```bash |
||||
|
npm run build:目标平台 |
||||
|
# 目标平台可选:win32, linux, mac详见 package.json |
||||
|
``` |
||||
|
@ -1,17 +1,30 @@ |
|||||
import { Button } from 'antd' |
import { Layout } from 'antd' |
||||
function App() { |
const { Sider, Content } = Layout |
||||
const ipcHandle = () => window.electron.ipcRenderer.send('ping') |
const contentStyle = { |
||||
|
textAlign: 'center', |
||||
return ( |
minHeight: 'calc(100vh - 20px)', |
||||
<> |
color: '#fff', |
||||
<div> |
backgroundColor: '#0958d9' |
||||
<h1>Hello Electron + antd!</h1> |
|
||||
<Button type="primary" onClick={ipcHandle}> |
|
||||
Antd Button send Ping to Main |
|
||||
</Button> |
|
||||
</div> |
|
||||
</> |
|
||||
) |
|
||||
} |
} |
||||
|
const siderStyle = { |
||||
|
textAlign: 'center', |
||||
|
color: '#fff', |
||||
|
backgroundColor: '#1677ff' |
||||
|
} |
||||
|
const layoutStyle = { |
||||
|
borderRadius: 8, |
||||
|
overflow: 'hidden', |
||||
|
width: 'calc(100% - 8px)', |
||||
|
maxWidth: 'calc(100% - 8px)' |
||||
|
} |
||||
|
const App = () => ( |
||||
|
<Layout style={layoutStyle}> |
||||
|
<Sider width={'20%'} style={siderStyle}> |
||||
|
Sider |
||||
|
</Sider> |
||||
|
<Layout> |
||||
|
<Content style={contentStyle}>Content</Content> |
||||
|
</Layout> |
||||
|
</Layout> |
||||
|
) |
||||
export default App |
export default App |
||||
|
Loading…
Reference in new issue