swiftui 嵌套 foreach 报错,请教大神帮忙看看

12次阅读

共计 314 个字符,预计需要花费 1 分钟才能阅读完成。

    var playResource: some View {LazyVStack(alignment: .leading) {ForEach(detailViewModel.videoDetail.ResourceModuleList, id: .id) { item in
                LazyVStack {Text(item.title)
                    ForEach(item.links, id:.id) { a in
                        LazyHStack {Button {} label: {Text(a.title)
                            }
                        }
                    }
                }
            }
        }
    }

swiftui 嵌套 foreach 报错,请教大神帮忙看看

报错文案:
Cannot convert value of type ‘[ResourceLink]’ to expected argument type ‘Binding

请问这是什么原因呀?

正文完
 0