barcode.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <script setup lang="ts">
  2. import ReBarcode from "@/components/ReBarcode";
  3. defineOptions({
  4. name: "BarCode"
  5. });
  6. const barcodes = [
  7. {
  8. text: "CODE128",
  9. type: "CODE128",
  10. options: {}
  11. },
  12. {
  13. text: "CODE39",
  14. type: "CODE39",
  15. options: {
  16. lineColor: "#990000"
  17. }
  18. },
  19. {
  20. text: "123456",
  21. type: "pharmacode",
  22. options: {
  23. background: "#eee",
  24. width: 5
  25. }
  26. }
  27. ];
  28. </script>
  29. <template>
  30. <div>
  31. <el-card shadow="never">
  32. <template #header>
  33. <div class="font-medium">
  34. 条形码(基于
  35. <el-link
  36. href="https://lindell.me/JsBarcode/"
  37. target="_blank"
  38. style="margin: 0 5px 4px 0; font-size: 16px"
  39. >
  40. JsBarcode
  41. </el-link>
  42. 生成)
  43. </div>
  44. <el-link
  45. class="mt-2"
  46. href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/able/barcode.vue"
  47. target="_blank"
  48. >
  49. 代码位置 src/views/able/barcode.vue
  50. </el-link>
  51. </template>
  52. <el-row :gutter="12">
  53. <template v-for="(item, index) in barcodes" :key="index">
  54. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  55. <el-card shadow="hover" class="flex justify-center">
  56. <ReBarcode
  57. :text="item.text"
  58. :type="item.type"
  59. :options="item.options"
  60. />
  61. </el-card>
  62. </el-col>
  63. </template>
  64. </el-row>
  65. </el-card>
  66. </div>
  67. </template>