1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.8/vue.min.js"></script> <script src="/js/JsBarcode.all.min.js"></script> </head> <style>- #app{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; } img{ width: auto; height: auto; max-width: 100%; max-height: 100%; } .imgbox{ height:80px; width:300px; } </style> <body> <div id="app"> <div class="imgbox" v-for='(item,index) in jsBarcodeList ' :key='index' > <img :id="'jsbarcodeImg' + index"/> </div> </div> </body> </html> <script>
const jsBarcodeList =['abc21312','qwe558','ttt999']; function generateJSBarcodeImg(){ jsBarcodeList.forEach((v,index)=>{ JsBarcode('#jsbarcodeImg' + index, v[0], { format: 'CODE39', text:v, width: 2, height: 50, fontSize:30, fontOptions: "bold" }) }) }
var vm = new Vue({ el:"#app", data:{}, mounted() { setTimeout(() => { generateJSBarcodeImg() }, 500) }, })
</<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.8/vue.min.js"></script> <script src="/js/JsBarcode.all.min.js"></script> </head> <style>- #app{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; } img{ width: auto; height: auto; max-width: 100%; max-height: 100%; } .imgbox{ height:80px; width:300px; } </style> <body> <div id="app"> <div class="imgbox" v-for='(item,index) in jsBarcodeList ' :key='index' > <img :id="'jsbarcodeImg' + index"/> </div> </div> </body> </html> <script>
const jsBarcodeList =['abc21312','qwe558','ttt999']; function generateJSBarcodeImg(){ jsBarcodeList.forEach((v,index)=>{ JsBarcode('#jsbarcodeImg' + index, v[0], { format: 'CODE39', text:v, width: 2, height: 50, fontSize:30, fontOptions: "bold" }) }) }
var vm = new Vue({ el:"#app", data:{}, mounted() { setTimeout(() => { generateJSBarcodeImg() }, 500) }, })
</script>
|