Renderers are now packages, not features. (#387)
* feat: use synchronous router design * feat: function to get router out of dom * chore: restructure workspace to use renderers as packages, not features
This commit is contained in:
1 parent
c97ca7dff6
commit
d9546d9504
181 files changed
+487
-1463
No files matched your search
@@ -24,7 +24,7 @@ pub fn use_window(cx: &ScopeState) -> &DesktopContext {
|
||||
///
|
||||
/// you can use `cx.consume_context::<DesktopContext>` to get this context
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust, ignore
|
||||
/// let desktop = cx.consume_context::<DesktopContext>().unwrap();
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
@@ -43,7 +43,7 @@ impl DesktopContext {
|
||||
/// Moves the window with the left mouse button until the button is released.
|
||||
///
|
||||
/// you need use it in `onmousedown` event:
|
||||
/// ```rust
|
||||
/// ```rust, ignore
|
||||
/// onmousedown: move |_| { desktop.drag_window(); }
|
||||
/// ```
|
||||
pub fn drag(&self) {
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::fmt::{self, Write};
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust,no_run
|
||||
/// ```rust,ignore
|
||||
/// # use web_view::WebView;
|
||||
/// # use std::mem;
|
||||
/// #
|
||||
|
||||
@@ -33,11 +33,11 @@ use wry::webview::WebViewBuilder;
|
||||
///
|
||||
/// This function will start a multithreaded Tokio runtime as well the WebView event loop.
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust, ignore
|
||||
/// use dioxus::prelude::*;
|
||||
///
|
||||
/// fn main() {
|
||||
/// dioxus::desktop::launch(app);
|
||||
/// dioxus_desktop::launch(app);
|
||||
/// }
|
||||
///
|
||||
/// fn app(cx: Scope) -> Element {
|
||||
@@ -56,11 +56,11 @@ pub fn launch(root: Component) {
|
||||
///
|
||||
/// You can configure the WebView window with a configuration closure
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust, ignore
|
||||
/// use dioxus::prelude::*;
|
||||
///
|
||||
/// fn main() {
|
||||
/// dioxus::desktop::launch_cfg(app, |c| c.with_window(|w| w.with_title("My App")));
|
||||
/// dioxus_desktop::launch_cfg(app, |c| c.with_window(|w| w.with_title("My App")));
|
||||
/// }
|
||||
///
|
||||
/// fn app(cx: Scope) -> Element {
|
||||
@@ -82,11 +82,11 @@ pub fn launch_cfg(
|
||||
///
|
||||
/// You can configure the WebView window with a configuration closure
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust, ignore
|
||||
/// use dioxus::prelude::*;
|
||||
///
|
||||
/// fn main() {
|
||||
/// dioxus::desktop::launch_cfg(app, AppProps { name: "asd" }, |c| c);
|
||||
/// dioxus_desktop::launch_cfg(app, AppProps { name: "asd" }, |c| c);
|
||||
/// }
|
||||
///
|
||||
/// struct AppProps {
|
||||
|
||||
@@ -26,12 +26,12 @@ $ cargo add dioxus --features desktop
|
||||
|
||||
Edit your `main.rs`:
|
||||
|
||||
```rust
|
||||
```rust, ignore
|
||||
// main.rs
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn main() {
|
||||
dioxus::desktop::launch(app);
|
||||
dioxus_desktop::launch(app);
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
|
||||
Reference in new issue
Block a user