Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit d3ea5d5

Browse files
committed
修复macOS串口显示
1 parent 443dc8e commit d3ea5d5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

backend/SerialHandle/SerialHandle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func FindSerialPorts() []string {
3838
log.Println("No serial ports found!")
3939
}
4040
for _, port := range tmp {
41-
if strings.Contains(port, "USB") || strings.Contains(port, "ACM") || strings.Contains(port, "COM") {
41+
if strings.Contains(port, "USB") || strings.Contains(port, "ACM") || strings.Contains(port, "COM") || strings.Contains(port, "tty.usb") {
4242
ports = append(ports, port)
4343
}
4444
}

frontend/src/components/SerialPort.vue

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
<v-list-item-title>串口</v-list-item-title>
55
</v-list-item>
66
<v-list-item>
7+
<v-list-item-action>
8+
<v-switch v-model="status" v-on:change="optSerial()" inset></v-switch>
9+
</v-list-item-action>
710
<v-select
8-
prepend-icon="mdi-serial-port"
911
:items="serialList"
1012
v-model="serial"
1113
v-on:click="getSerialList()"
1214
v-bind:disabled="status"
1315
label="选择串口"
1416
></v-select>
15-
<v-list-item-action>
16-
<v-switch v-model="status" v-on:change="optSerial()" inset></v-switch>
17-
</v-list-item-action>
1817
</v-list-item>
1918
</v-list>
2019
</template>

0 commit comments

Comments
 (0)