ElementUI 使用

2021-06-07  本文已影响0人  山与海Lucky7

表格-根据不同的值显示不同的标签

<el-table-column  prop="fulfill"  label="配置状态">
     <template slot-scope="scope">
           <el-tag type="warning" v-if="scope.row.fulfill === 1">待完善</el-tag>
           <el-tag type="success" v-else-if="scope.row.fulfill === 0">已完善</el-tag>
     </template>
</el-table-column>

分页

<el-pagination
                style="text-align: center;"
                @size-change="changeLimit"
                @current-change="changePage"
                :current-page="queryForm.page"
                :page-sizes="[8, 12, 16, 20]"
                :page-size="queryForm.limit"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total">
</el-pagination>
data() {
    return {
        page: 1,
        limit: 8,
        total: 0
    }
}


methods: {
    changePage(val) {
            this.page = val;
    },
    changeLimit(val) {
            this.limit = val;
    }
}


上一篇 下一篇

猜你喜欢

热点阅读