LabelPreview.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="label-preview" :style="getAreaStyle()">
  3. <SerialNumberPosition v-if="isEnable(data.property.sn_display_mode)" :property="data.property" />
  4. <div class="main">
  5. <el-tag v-for="(tag, i) in data.dynamicTags" :key="i" :style="{ color: tag.color }">
  6. {{ tag.text }}
  7. </el-tag>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import { getLabelData } from '@/views/book/courseware/data/label';
  13. import PreviewMixin from '../common/PreviewMixin';
  14. export default {
  15. name: 'LabelPreview',
  16. mixins: [PreviewMixin],
  17. data() {
  18. return {
  19. data: getLabelData(),
  20. };
  21. },
  22. methods: {},
  23. };
  24. </script>
  25. <style lang="scss" scoped>
  26. @use '@/styles/mixin.scss' as *;
  27. .label-preview {
  28. @include preview-base;
  29. .main {
  30. display: flex;
  31. flex-wrap: wrap;
  32. gap: 8px;
  33. :deep .el-tag {
  34. height: 32px;
  35. padding: 0 10px;
  36. line-height: 30px;
  37. color: var(--color1);
  38. background-color: #fff;
  39. border-color: var(--color1);
  40. border-radius: 2px;
  41. }
  42. }
  43. }
  44. </style>