<template>
  <div class="course-barcode">
    <img
      v-if="data.courseCodeBarcodeSrc"
      :src="data.courseCodeBarcodeSrc"
      :alt="data.courseCodeBarcodeName"
    />
    <img
      v-else
      src="../assets/images/barcode-sample-notext.png"
      alt="课程代码条码"
    />
    <p>{{ data.courseCodeBarcodeName || "123456789" }}</p>
  </div>
</template>

<script>
export default {
  name: "course-barcode",
  props: {
    data: {
      type: Object,
      default() {
        return { courseCodeBarcodeSrc: "", courseCodeBarcodeName: "" };
      },
    },
  },
  data() {
    return {};
  },
};
</script>
