diff --git a/example/qml/page/T_TableView.qml b/example/qml/page/T_TableView.qml index f24cac13..0e8b18e0 100644 --- a/example/qml/page/T_TableView.qml +++ b/example/qml/page/T_TableView.qml @@ -87,7 +87,7 @@ FluScrollablePage{ text:"删除" horizontalPadding: 6 onClicked:{ - showError(JSON.stringify(dataObject)) + table_view.remove(dataModel.index) } } } diff --git a/src/imports/FluentUI/Controls/FluTableView.qml b/src/imports/FluentUI/Controls/FluTableView.qml index d7334df9..6350d19e 100644 --- a/src/imports/FluentUI/Controls/FluTableView.qml +++ b/src/imports/FluentUI/Controls/FluTableView.qml @@ -138,6 +138,9 @@ Item { width: Math.max(layout_flickable.width,d.columnsWidth) clip:true interactive: false + removeDisplaced: Transition { + NumberAnimation { properties: "x,y"; duration: 167 } + } header: header_columns footer: Item{ height: pageVisible ? 54 : 0 @@ -287,4 +290,8 @@ Item { } return data; } + function remove(index){ + model_data_source.remove(index) + console.debug(index) + } }