Skip to content

小建议 #7

Description

@diexuewolf

建议:
` Slider(
value = prompt.piority.toFloat(),
valueRange = 0f..10f,
onValueChange = { newValue ->
// 1. 格式化值(可选)
val formattedValue = "%.2f".format(newValue).toInt()

                            // 2. 通过回调更新状态(推荐不可变更新)
                            updateListByPrompt(prompt) { oldPrompt ->
                                oldPrompt.copy(piority = formattedValue)
                            }
                        })`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions