Skip to content

Instantly share code, notes, and snippets.

@phansch

phansch/app.js

Last active Jun 2, 2020
Embed
What would you like to do?
vue-tables-2 pagination on top and bottom
import {Event, ServerTable} from 'vue-tables-2';
import Vue from 'vue/dist/vue.esm';
var template = require('template.js')('server');
Vue.use(ServerTable, options, false, template);
module.exports = function (source) {
return function (h) {
var rows = require('vue-tables-2/compiled/template/rows')(h, this);
var normalFilter = require('vue-tables-2/compiled/template/normal-filter')(h, this);
var dropdownPagination = require('vue-tables-2/compiled/template/dropdown-pagination')(h, this);
var columnFilters = require('vue-tables-2/compiled/template/column-filters')(h, this);
var footerHeadings = require('vue-tables-2/compiled/template/footer-headings')(h, this);
var noResults = require('vue-tables-2/compiled/template/no-results')(h, this);
var pagination = require('vue-tables-2/compiled/template/pagination')(h, this);
var dropdownPaginationCount = require('vue-tables-2/compiled/template/dropdown-pagination-count')(h, this);
var headings = require('vue-tables-2/compiled/template/headings')(h, this);
var perPage = require('vue-tables-2/compiled/template/per-page')(h, this);
var columnsDropdown = require('vue-tables-2/compiled/template/columns-dropdown')(h, this);
var beforeFilters = this.$slots.beforeFilters ? this.$slots.beforeFilters : '';
var afterFilters = this.$slots.afterFilters ? this.$slots.afterFilters : '';
var beforeBody = this.$slots.beforeBody ? this.$slots.beforeBody : '';
var prependBody = this.$slots.prependBody ? this.$slots.prependBody : '';
var appendBody = this.$slots.appendBody ? this.$slots.appendBody : '';
var afterBody = this.$slots.afterBody ? this.$slots.afterBody : '';
var beforeTable = this.$slots.beforeTable ? this.$slots.beforeTable : '';
var prependFilterContainer = this.$slots.prependFilterContainer ? this.$slots.prependFilterContainer : '';
var appendFilterContainer = this.$slots.appendFilterContainer ? this.$slots.appendFilterContainer : '';
var prependLimitContainer = this.$slots.prependLimitContainer ? this.$slots.prependLimitContainer : '';
var appendLimitContainer = this.$slots.appendLimitContainer ? this.$slots.appendLimitContainer : '';
return h(
'div',
{ 'class': "VueTables VueTables--" + this.source },
// Pagination one
[pagination, beforeTable, h(
'div',
{ 'class': 'table-responsive' },
[h(
'table',
{ 'class': 'VueTables__table table ' + this.opts.skin },
[h(
'thead',
null,
[h(
'tr',
null,
[headings]
), beforeFilters, columnFilters, afterFilters]
), footerHeadings, beforeBody, h(
'tbody',
null,
[prependBody, noResults, rows, appendBody]
), afterBody]
), h(
'div',
{ 'class': 'table-footer' },
// Pagination two
[pagination, prependLimitContainer, perPage, appendLimitContainer, pagination, columnsDropdown]
)]
)]
);
};
};
@alejin2698

This comment has been minimized.

Copy link

@alejin2698 alejin2698 commented Oct 24, 2018

hi , you can to do that?

@MosheL

This comment has been minimized.

Copy link

@MosheL MosheL commented Jun 2, 2020

did not work today as they change the code. I will try to make a working code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment