Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sabbir345's avatar

Eliment UI Table index problem

i have a eliment ui table. when i am click eliment ui pagination . after one page index start with 1 .

example : if first page 10 row. then legally second page row start index with 11 , 12 and so on but my index start with 1 , 2

Here is my Code

<el-table :data="adminlog" stripe border style="width: 100%"> <el-table-column type="index" label="ID" width="180"> </el-table-column>

            <el-table-column
                  prop="created_at"
                  label="Login Time">
            </el-table-column>
            
            </el-table>

<el-pagination background class="fix" @current-change="handleCurrentChange" :page-size="perPage" layout="total, prev, pager, next" :total="totalData"> </el-pagination>

export default {

    data () {

        return {
            adminlog:[],
            perPage: 10,
            totalData: 0,
        }
    },
    methods: {
        handleCurrentChange(next) {
            this.TableData(next);
        },
        TableData(nextPage = null){
            let url = `http://127.0.0.1:8000/admin/log-data?per_page=${this.perPage}`;
            if (nextPage) {
                url += `&page=${nextPage}`;
            }
            axios.get(url)
            .then((response) => {
                this.adminlog  = response.data.adminLogList.data
                this.totalData = response.data.adminLogList.total;
            })
            .catch((error) => {

            })
        }
    },
    mounted () {
        this.TableData();
        
    },

}
0 likes
0 replies

Please or to participate in this conversation.