Sha256: 7bd7c6a53e051d394041d4a03bc5866acb3a4c0d182fd8adc6bbe5af894d5cb9

Contents?: true

Size: 800 Bytes

Versions: 15

Compression:

Stored size: 800 Bytes

Contents

<template>
  <span class="listing-filter" @click.prevent="filter()">{{label}}
    <i v-if="activeFilters[type] == 'ASC'" class="fa fa-arrow-down"></i>
    <i v-if="activeFilters[type] == 'DESC'" class="fa fa-arrow-up"></i>
  </span>
</template>

<script>
import {mapState} from 'vuex'

export default {
  props: ['label', 'type'],
  data () {
    return {}
  },
  computed: {
    ...mapState('mediasStore', ['activeFilters'])
  },
  methods: {
    filter () {
      this.$store.dispatch('mediasStore/setSearchPage', 1)
      this.$store.dispatch('mediasStore/clearImgListing')
      this.$store.dispatch('mediasStore/toggleFilter', this.type)
      this.$store.dispatch('mediasStore/fetchImage')
    }
  }
}
</script>
<style media="screen" lang="sass">
  .listing-filter
    cursor: pointer
</style>

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rails_admin_image_manager-0.1.34 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.33 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.31 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.30 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.3 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.29 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.28 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.27 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.26 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.25 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.24 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.23 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.22 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.21 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue
rails_admin_image_manager-0.1.20 app/assets/javascripts/rails_admin_image_manager/components/listingFilter.vue