此功能是基于插件实现的,具体插件可以自行在插件市场下载使用,下载地址:条形码生成器 - DCloud 插件市场
最终实现效果:
微信APP能够扫码识别的条形码类型有code128\code39\ean13\ean8\upc\itf14,这里使用的是code128
1.将 tki-barcode 添加到对应的components包目录
2.在template中添加
<tk i-barcode :loadMake="false" :opations="opations" :onval="true" format="code128" :val="val" ref="barcode" @result="barresult"></tki-barcode>
3.在script中添加
import tkiBarcode from "@/components/tki-barcode/tki-barcode.vue"
export default {
components: {tkiBarcode},
data(){
return{
opations