Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增第一层点击选择功能 #355

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class _TDMultiCascaderState extends State<TDMultiCascader> with TickerProviderSt
return GestureDetector(
onTap: () {
int level = 0;
if (_tabListData.length > 2 && _currentTabIndex == 0) {
if (item.level ==0 && _currentTabIndex == 0) {
_tabListData.clear();
_tabListData.add(MultiCascaderListModel(
label: '选择选项',
Expand Down Expand Up @@ -439,7 +439,7 @@ class _TDMultiCascaderState extends State<TDMultiCascader> with TickerProviderSt

void _getChildrenListData(int level, String value) {
//查询层级数据
var selectLevelData = _listData.where((element) => element.level == (level)).toList();
var selectLevelData = _listData.where((element) => element.level == (level)&&element.parentValue==value).toList();
//判断下级是否存在
if (selectLevelData.isNotEmpty) {
//获取下级数据
Expand Down