all files / components/ VuetablePaginationInfo.vue

54.55% Statements 6/11
28.57% Branches 4/14
25% Functions 1/4
28.57% Lines 2/7
1 branch Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40                                                                             
// <template>
//   <div :class="[{'vuetable-pagination-info': true}, paginationInfoClass]"
//     v-html="paginationInfo">
//   </div>
// </template>
//
// <script>
import PaginationInfoMixin from './VuetablePaginationInfoMixin.vue'
 
export default {
  name: 'pagination-info',
  mixins: [PaginationInfoMixin],
  computed: {
    paginationInfo () {
      if (this.tablePagination == null || this.tablePagination.total == 0) {
        return this.paginationInfoNoDataTemplate
      }
 
      return this.paginationInfoTemplate
        .replace('{from}', this.tablePagination.from || 0)
        .replace('{to}', this.tablePagination.to || 0)
        .replace('{total}', this.tablePagination.total || 0)
    },
  },
  data: function() {
    return {
      tablePagination: null
    }
  },
  methods: {
    setPaginationData (tablePagination) {
      this.tablePagination = tablePagination
    },
  },
}
// </script>
 
/* generated by vue-loader */