mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-26 04:03:29 +03:00
feat(docs): document data URLs usage (#3360)
This commit is contained in:
parent
a2d5929a8f
commit
4a10e88c4b
@ -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)]
|
||||
|
@ -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>,
|
||||
|
@ -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,
|
||||
|
@ -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.. */
|
||||
|
Loading…
Reference in New Issue
Block a user