Having a problem with arguments to command containing underscores. #10069
-
I'm using tauri with leptos. Here is my tauri-side code:
Here is my leptos-side code:
The code works when the argument name is datatype. However, it doesn't work when the argument name is data_type. Is there a reason the underscore breaks commands/ |
Beta Was this translation helpful? Give feedback.
Answered by
FabianLars
Jun 17, 2024
Replies: 1 comment 1 reply
-
The command arguments will be converted to what's considered standard in JS, so #[tauri::command(rename_all = "snake_case")] |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
TheRealSalmon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The command arguments will be converted to what's considered standard in JS, so
data_type
in rust will bedataType
in javascript. You can disable this by changing the command annotation to this#[tauri::command(rename_all = "snake_case")]