其他分享
首页 > 其他分享> > swiftui命令

swiftui命令

作者:互联网

Button(
                action: {
                    isPerformingTask = true
                    api = apilist.filter(){$0 != api}.randomElement()!
                    Task {
                        await loadData()
                        isPerformingTask = false
                    }
                },
                label: {
                        Text("换一批").opacity(isPerformingTask ? 0 : 1)
                }
            )
            .disabled(isPerformingTask)
 .contextMenu {
                            Button {
                                // Add this item to a list of favorites.
                            } label: {
                                Label("Add to Favorites", systemImage: "heart")
                            }
                            Button {
                                // Open Maps and center it on this item.
                            } label: {
                                Label("Show in Maps", systemImage: "mappin")
                            }
                        }

2022-07-22

标签:Maps,Button,Label,命令,Add,swiftui,label,isPerformingTask
来源: https://www.cnblogs.com/dengxinkai/p/16504149.html