Skip to content

Commit b37f5c8

Browse files
committed
适配下移动端
1 parent 0cd8b42 commit b37f5c8

File tree

4 files changed

+34
-20
lines changed

4 files changed

+34
-20
lines changed

src/App.vue

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,33 @@
22
<div class="container" style="justify-content:normal;">
33
<el-row>
44
<!-- 左半屏幕 -->
5-
<el-col :span="12">
5+
<el-col :xs="24" :sm="24" :md="12">
66
<div class="LeftMain">
77
<WaveGen msg="波形发生器控制面板" />
88
<WaveGenChart width="550" height="350" container="WaveGenChart"></WaveGenChart>
99
</div>
1010
</el-col>
1111
<!-- 右半屏幕 -->
12-
<el-col :span="12">
13-
<el-row justify="end" style="height:32px;">
14-
<el-form-item label="连接设备" style="margin-right: 20px;">
15-
<el-switch v-model="isConnected" @change="connectDevice()" inline-prompt active-text=""
16-
inactive-text="" />
17-
</el-form-item>
18-
<el-form-item label="深色模式" style="margin-right: 20px;">
19-
<el-switch v-model="switchVal" @change="toggleDark(), UseDarkMode()" inline-prompt active-text=""
20-
inactive-text="" />
21-
</el-form-item>
22-
</el-row>
23-
<el-row>
24-
<el-col :span="24">
25-
<h2>ESP32示波器面板</h2>
26-
<OSChart width="550" height="350" container="OSChart"></OSChart>
27-
</el-col>
28-
</el-row>
12+
<el-col :xs="24" :sm="24" :md="12">
13+
<div class="RightMain">
14+
<el-row justify="end" style="height:32px;">
15+
<el-form-item label="连接设备" style="margin-right: 20px;">
16+
<el-switch v-model="isConnected" @change="connectDevice()" inline-prompt active-text=""
17+
inactive-text="" />
18+
</el-form-item>
19+
<el-form-item label="深色模式" style="margin-right: 20px;">
20+
<el-switch v-model="switchVal" @change="toggleDark(), UseDarkMode()" inline-prompt active-text=""
21+
inactive-text="" />
22+
</el-form-item>
23+
</el-row>
24+
<el-row>
25+
<el-col :span="24">
26+
<h2>ESP32示波器面板</h2>
27+
<OSChart width="550" height="350" container="OSChart"></OSChart>
28+
</el-col>
29+
</el-row>
30+
</div>
31+
2932

3033
</el-col>
3134
</el-row>
@@ -96,6 +99,13 @@ onMounted(() => {
9699
<style>
97100
.LeftMain {
98101
width: 100%;
102+
min-width: 550px;
103+
height: auto;
104+
}
105+
106+
.RightMain {
107+
width: 100%;
108+
min-width: 550px;
99109
height: auto;
100110
}
101111

src/components/OSChart.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@ onMounted(() => {
265265
}
266266
267267
.OSCForm {
268-
width: 50%;
268+
width: 55%;
269+
height: auto;
269270
margin: 0 auto;
271+
min-width: 360px;
272+
font-size: 2em;
270273
}
271274
</style>

src/components/WaveGen.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ defineProps<{ msg: string }>();
133133
<style>
134134
.waveGen {
135135
width: 55%;
136+
min-width: 360px;
136137
height: auto;
137138
margin: 0 auto;
138139
font-size: 2em;

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default defineConfig({
3434
viteCompression({
3535
verbose: true,
3636
disable: false,
37-
threshold: 10240,
37+
threshold: 1,
3838
algorithm: 'gzip',
3939
ext: '.gz',
4040
}),

0 commit comments

Comments
 (0)