Ei kuvausta

BaseContent.vue 973B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <a class="list-item" :class="isShowImg(itemSingle.catalog)" :href="'content.html?id='+itemSingle.id" :target="noBlank ? '' : '_blank'">
  3. <div class="list-head" :style="{backgroundImage: 'url(' + imgUrl + ')'}"></div>
  4. <div class="list-info">
  5. <div class="list-tit">{{itemSingle.title}}</div>
  6. <ul class="list-tag">
  7. <li>{{itemSingle.modifyTime}}</li>
  8. </ul>
  9. </div>
  10. </a>
  11. </template>
  12. <script>
  13. import { defaultSet } from '@/libs/util';
  14. export default {
  15. props: {
  16. itemSingle: {
  17. type: Object
  18. },
  19. noBlank: {
  20. type: Boolean,
  21. default: false
  22. }
  23. },
  24. data() {
  25. return {
  26. imgUrl: this.itemSingle.imgUrl || defaultSet.img.article
  27. };
  28. },
  29. methods: {
  30. isShowImg(catalog) {
  31. if (catalog === '1' || catalog === '2' || catalog === '5') {
  32. return ''
  33. } else {
  34. return 'list-item-info'
  35. }
  36. }
  37. }
  38. };
  39. </script>