feat(docs): document data URLs usage (#3360)

This commit is contained in:
Lucas Fernandes Nogueira 2022-02-08 11:11:32 -03:00 committed by GitHub
parent a2d5929a8f
commit 4a10e88c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -29,7 +29,7 @@ pub mod parse;
pub use self::parse::parse;
/// The window webview URL options.
/// An URL to open on a Tauri webview window.
#[derive(PartialEq, Debug, Clone, Deserialize, Serialize)]
#[cfg_attr(feature = "schema", derive(JsonSchema))]
#[serde(untagged)]

View File

@ -357,6 +357,8 @@ macro_rules! shared_app_impl {
($app: ty) => {
impl<R: Runtime> $app {
/// Creates a new webview window.
///
/// Data URLs are only supported with the `window-data-url` feature flag.
pub fn create_window<F>(
&self,
label: impl Into<String>,

View File

@ -179,6 +179,8 @@ impl<R: Runtime> Window<R> {
}
/// Creates a new webview window.
///
/// Data URLs are only supported with the `window-data-url` feature flag.
pub fn create_window<F>(
&mut self,
label: String,

View File

@ -1145,7 +1145,11 @@ const appWindow = new WebviewWindow(
/** Configuration for the window to create. */
interface WindowOptions {
/**
* Remote URL or local file path to open, e.g. `https://github.com/tauri-apps` or `path/to/page.html`.
* Remote URL or local file path to open.
*
* - URL such as `https://github.com/tauri-apps` is opened directly on a Tauri window.
* - data: URL such as `data:text/html,<html>...` is only supported with the `window-data-url` Cargo feature for the `tauri` dependency.
* - local file path or route such as `/path/to/page.html` or `/users` is appended to the application URL (the devServer URL on development, or `tauri://localhost/` and `https://tauri.localhost/` on production).
*/
url?: string
/** Show window in the center of the screen.. */