<template>
    <el-button @click="chooseSerial">打印</el-button>
</template>

<script setup>
import { ipcRenderer } from 'electron'

//选择串口设备
const chooseSerial = async () => {
    let printNum = localStorage.getItem('printNum')
    if (!printNum) {
        printNum = 1
        localStorage.setItem('printNum', printNum)
    } else {
        printNum++
        localStorage.setItem('printNum', printNum)
    }
    ipcRenderer.send('printStart', printNum)
};
</script>