【发布时间】:2020-10-22 14:08:32
【问题描述】:
我正在使用 Laravel 和 Vuejs 并想使用条形码扫描仪创建发票。除了条形码扫描之外,一切都工作正常。在这个阶段如何使用条形码扫描仪插入行? 在我的代码示例下方。
addNewLine(){
this.form.items.push({
barcode:null,
name:null,
price:0,
qty:0,
subtotal:0
})
}
<div<input type="search" v-model="barcode"></div>
<table>
<thead>
<tr>
<th>SL</th>
<th>Barcode</th>
<th>Item Name</th>
<th>Sale Price</th>
<th>Quantity</th>
<th>Subtotal</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in form.items">
<td>{{index + 1}}</td>
<td><input type="text"v-model="item.barcode"/></td>
<td><input type="text"v-model="item.name"/></td>
<td><input type="text"v-model="item.price"/></td>
<td><input type="text"v-model="item.qty"/></td>
<td><input type="text"v-model="item.subtotal"/></td>
</tr>
</tbody>
</table>
<button class="btn btn-sm " @click="addNewLine">Add New Line</button>
【问题讨论】:
-
条码扫描仪是什么意思?是字符串还是数字?在这个例子中究竟是什么不起作用?你得到什么错误或错误?
-
条码扫描仪是指扫描仪机器。我的问题是如何使用条形码扫描仪插入行(新行)?
标签: laravel laravel-5 vuejs2 laravel-vue