| | |
| | | /* left: 50px; !* 设置距离页面左侧的位置 *!*/ |
| | | /*}*/ |
| | | </style> |
| | | |
| | | <!--<template>--> |
| | | <!-- <div>--> |
| | | <!-- <div--> |
| | | <!-- v-for="(scanCode, index) in scanCodes"--> |
| | | <!-- :key="index"--> |
| | | <!-- >--> |
| | | <!-- <input--> |
| | | <!-- :ref="`scanCodeInput${index}`"--> |
| | | <!-- type="text"--> |
| | | <!-- @input="handleScanCodeInput(index, $event)"--> |
| | | <!-- />--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!--</template>--> |
| | | |
| | | <!--<script>--> |
| | | <!--export default {--> |
| | | <!-- data() {--> |
| | | <!-- return {--> |
| | | <!-- scanCodes: ['', '', ''], // 假设有3个扫码框--> |
| | | <!-- };--> |
| | | <!-- },--> |
| | | <!-- methods: {--> |
| | | <!-- handleScanCodeInput(index, event) {--> |
| | | <!-- const value = event.target.value;--> |
| | | <!-- // 当扫码内容改变时,可以在这里添加检查扫码的逻辑--> |
| | | <!-- if (value.length === 4) { // 假设扫码长度是4--> |
| | | <!-- // 移动到下一个扫码框--> |
| | | <!-- if (index < this.scanCodes.length - 1) {--> |
| | | <!-- this.$refs[`scanCodeInput${index + 1}`][0].focus();--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- },--> |
| | | <!--};--> |
| | | <!--</script>--> |