<avue-crud :option="option" :data="data" @sortable-change="sortableChange"></avue-crud>
<script>
export default {
data(){
return {
data:[{
text1:'内容1-1',
text2:'内容1-2'
},{
text1:'内容2-1',
text2:'内容2-2'
},{
text1:'内容3-1',
text2:'内容3-2'
},{
text1:'内容4-1',
text2:'内容4-2'
},{
text1:'内容5-1',
text2:'内容5-2'
}],
option:{
rowSort:true,
column: [{
label: '列内容1',
prop: 'text1',
}, {
label: '列内容2',
prop: 'text2',
}]
}
}
},
methods:{
sortableChange(oldindex, newindex, row, list) {
this.$message.success(oldindex+','+newindex)
console.log(oldindex, newindex)
}
}
}
</script>
前端那些事20240201-前端那些事-avue2 表格行配置 行拖拽排序
最新推荐文章于 2024-03-15 11:50:39 发布