MiniCard.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <article class="card minicard">
  3. <header>
  4. <h1>{{ item.title }}</h1>
  5. <span class="ref">{{ item.field_reference }}</span>
  6. </header>
  7. <nav class="tools">
  8. <section class="tool flags">
  9. <span class="mdi mdi-folder-remove-outline"/>
  10. </section>
  11. </nav>
  12. <section class="images" v-switcher>
  13. <figure
  14. v-for="(img, index) in item.images"
  15. :key="img.url"
  16. >
  17. <img
  18. class="lazy"
  19. v-lazy="index"
  20. :data-src="img.url"
  21. :title="img.title"
  22. />
  23. <img class="blank" :src="blanksrc">
  24. </figure>
  25. </section>
  26. </article>
  27. </template>
  28. <script>
  29. import { mapState, mapActions } from 'vuex'
  30. import cardMixins from 'vuejs/components/cardMixins'
  31. export default {
  32. name: "MiniCard",
  33. props: ['item'],
  34. mixins: [cardMixins],
  35. data() {
  36. return {
  37. blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,
  38. // loadingFlag: false
  39. }
  40. },
  41. computed: {
  42. // ...mapState({
  43. // flagcolls: state => state.User.flagcolls
  44. // })
  45. },
  46. methods: {
  47. // ...mapActions({
  48. // flag: 'User/flag',
  49. // unFlag: 'User/unFlag'
  50. // }),
  51. // flagIsActive(collid) {
  52. // // console.log(this.item.uuid);
  53. // // console.log(this.flagcolls[collid].items_uuids);
  54. // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;
  55. // },
  56. // flagIsLoading(collid) {
  57. // // console.log(this.item.uuid);
  58. // // console.log(this.flagcolls[collid].items_uuids);
  59. // return collid === this.loadingFlag;
  60. // },
  61. // onFlagActionCard (e) {
  62. // console.log("Card onFlagActionCard", e);
  63. // if (!this.loadingFlag) {
  64. // let collid = e.target.getAttribute('collid');
  65. // let isActive = this.flagIsActive(collid);
  66. // // console.log('collid', collid);
  67. // // console.log("this.item", this.item);
  68. // this.loadingFlag = collid;
  69. // if (isActive) {
  70. // this.unFlag({uuid: this.item.uuid, collid: collid})
  71. // .then(data => {
  72. // console.log("onFlagActionCard then", data);
  73. // this.loadingFlag = false;
  74. // })
  75. // }else{
  76. // this.flag({uuid: this.item.uuid, collid: collid})
  77. // .then(data => {
  78. // console.log("onFlagActionCard then", data);
  79. // this.loadingFlag = false;
  80. // })
  81. // }
  82. // }
  83. // }
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. </style>