import { tpl } from './paginationTpl';
const Pagination = (($) => {
    const DefaultConfig = {
        tpl: tpl,
        current: 1,
        total: 18
    }
    class Pagination {
        constructor(config) {
            this._config = this._getConfig(config);
            this._element = this._config.node;
            this._$el = $(this._element);
            this._$el.html(this._renderDom(this._config));
            this._addEvent();
        }
        _renderDom(config) {
            return template.render(this._config.tpl, config);
        }
        _getConfig(config) {
            return $.extend(true,{},DefaultConfig, config);
        }
        _addEvent() {
        }
        goPage(num) {
            console.log('到第' + num + '页');
        }
        prePage() {
            console.log('前一页')
        }
        nextPage() {
            console.log('后一页')
        }
        getCurrentPage() {
            console.log('获得当前页码')
        }
        goFirstPage() {
            console.log('到第一页')
        }
        goLastPage() {
            console.log('到最后一页')
        }
        getTotalPage() {
            return 10;
        }
        _dispose(){
            console.log('析构')
        }
    }
    return Pagination;
})($);
export default Pagination;