update list demo

This commit is contained in:
王劲鹏 2022-06-17 15:44:01 +08:00 committed by osborn
parent 1e7637a1dc
commit e5e0471ff4

View File

@ -65,6 +65,13 @@ class ListVH extends ViewHolder {
class ListVM extends ViewModel<ListModel, ListVH> {
onAttached(state: ListModel, vh: ListVH) {
vh.list.apply({
canDrag: true,
onDragging: (from, to) => {
log(`onDragging, from: ${from}, to: ${to}`)
},
onDragged: (from, to) => {
log(`onDragged, from: ${from}, to: ${to}`)
},
renderItem: (index) => {
const data = state.data[index]
return listItem(stack([