elementUI表格排序问题

elementUI表格排序:
问题:得不到排序后的数组,每次打印的总是一开始的数据

        <el-table
        ref="passTable" 
        :data="passTable" 
        border
        height="300"
        :default-sort = "{prop: 'QMNO', order: 'ascending'}"
        style="width:70%;margin: 20px 0 50px 0;">


        <el-table-column label="串码" width="150" prop="QMNO" sortable></el-table-column>
        <el-table-column label="校验结果" prop="checkMessage">
            
        </el-table-column>
        
    </el-table>

解决方法:
先用ref绑定该表格
this.$refs.passTable.tableData就是每次你排序之后的数据

猜你喜欢

转载自www.cnblogs.com/yinxingen/p/9252858.html