我不明白如何在 macOS 上删除或移动项目。我需要用鼠标执行什么操作来触发onDelete或onMove事件?
@State var wishList = ["Item 1", "Item 2", "Item3"]
var body: some View {
List {
ForEach(wishList, id:\.self) { item in
Button(action: {
}) {
Text(item)
}
}
.onDelete { offsets in
}
.onMove { source, target in
}
}
}
Run Code Online (Sandbox Code Playgroud) swiftui ×1