Added additional examples for open and open_multiple in documentation.

This commit is contained in:
Brian Carlsen 2022-11-13 17:05:42 +01:00
parent 4018fd1177
commit ca061b9c1a

View file

@ -189,6 +189,10 @@ pub async fn message(message: &str, options: Option<MessageDialogOptions>) {
/// use tauri_api::dialog::{open, OpenDialogOptions};
///
/// let file = open(None).await;
///
/// let mut opts = OpenDialogOptions::new();
/// opts.directory = true;
/// let dir = open(Some(opts)).await;
/// ```
/// @param options Dialog options.
/// @returns List of file paths, or `None` if user cancelled the dialog.
@ -214,6 +218,11 @@ pub async fn open(options: Option<OpenDialogOptions>) -> Option<PathBuf> {
/// use tauri_api::dialog::{open, OpenDialogOptions};
///
/// let files = open_multiple(None).await;
///
/// let mut opts = OpenDialogOptions::new();
/// opts.multiple = true;
/// opts.directory = true;
/// let dirs = open(Some(opts)).await;
/// ```
/// @param options Dialog options.
/// @returns List of file paths, or `None` if user cancelled the dialog.