Skip to content

Having a problem with arguments to command containing underscores. #10069

Closed Answered by FabianLars
TheRealSalmon asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a reason the underscore breaks commands/invoke?

The command arguments will be converted to what's considered standard in JS, so data_type in rust will be dataType in javascript. You can disable this by changing the command annotation to this

#[tauri::command(rename_all = "snake_case")]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TheRealSalmon
Comment options

Answer selected by TheRealSalmon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants