mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
formatting: run cargo fmt
This commit is contained in:
parent
5da0a0c97e
commit
a95dead76d
4 changed files with 13 additions and 22 deletions
|
@ -27,7 +27,7 @@ fn app(cx: Scope) -> Element {
|
|||
let description = use_state(&cx, String::new);
|
||||
|
||||
cx.render(rsx!(
|
||||
body {
|
||||
body {
|
||||
margin_left: "35%",
|
||||
link {
|
||||
rel: "stylesheet",
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
//! Example: Basic Tailwind usage
|
||||
//!
|
||||
//!
|
||||
//! This example shows how an app might be styled with TailwindCSS.
|
||||
//!
|
||||
//!
|
||||
//! To minify your tailwind bundle, currently you need to use npm. Follow these instructions:
|
||||
//!
|
||||
//!
|
||||
//! https://dev.to/arctic_hen7/how-to-set-up-tailwind-css-with-yew-and-trunk-il9
|
||||
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn main() {
|
||||
|
@ -44,7 +43,7 @@ pub fn app(cx: Scope) -> Element {
|
|||
RightArrowIcon {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
section { class: "text-gray-400 bg-gray-900 body-font",
|
||||
div { class: "container mx-auto flex px-5 py-24 md:flex-row flex-col items-center",
|
||||
|
@ -73,11 +72,11 @@ pub fn app(cx: Scope) -> Element {
|
|||
}
|
||||
}
|
||||
div { class: "lg:max-w-lg lg:w-full md:w-1/2 w-5/6",
|
||||
img {
|
||||
class: "object-cover object-center rounded",
|
||||
img {
|
||||
class: "object-cover object-center rounded",
|
||||
src: "https://i.imgur.com/oK6BLtw.png",
|
||||
referrerpolicy:"no-referrer",
|
||||
alt: "hero",
|
||||
alt: "hero",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,8 +85,6 @@ pub fn app(cx: Scope) -> Element {
|
|||
))
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub fn StacksIcon(cx: Scope) -> Element {
|
||||
cx.render(rsx!(
|
||||
svg {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use dioxus::prelude::*;
|
||||
|
||||
|
||||
fn main() {
|
||||
dioxus::desktop::launch(app);
|
||||
}
|
||||
|
@ -19,7 +18,6 @@ pub struct TodoItem {
|
|||
pub contents: String,
|
||||
}
|
||||
|
||||
|
||||
pub fn app(cx: Scope<()>) -> Element {
|
||||
let todos = use_state(&cx, || im_rc::HashMap::<u32, TodoItem>::default());
|
||||
let filter = use_state(&cx, || FilterState::All);
|
||||
|
@ -80,9 +78,9 @@ pub fn app(cx: Scope<()>) -> Element {
|
|||
}
|
||||
(!todos.is_empty()).then(|| rsx!(
|
||||
footer { class: "footer",
|
||||
span { class: "todo-count",
|
||||
strong {"{items_left} "}
|
||||
span {"{item_text} left"}
|
||||
span { class: "todo-count",
|
||||
strong {"{items_left} "}
|
||||
span {"{item_text} left"}
|
||||
}
|
||||
ul { class: "filters",
|
||||
li { class: "All", a { onclick: move |_| filter.set(FilterState::All), "All" }}
|
||||
|
@ -90,8 +88,8 @@ pub fn app(cx: Scope<()>) -> Element {
|
|||
li { class: "Completed", a { onclick: move |_| filter.set(FilterState::Completed), "Completed" }}
|
||||
}
|
||||
(show_clear_completed).then(|| rsx!(
|
||||
button {
|
||||
class: "clear-completed",
|
||||
button {
|
||||
class: "clear-completed",
|
||||
onclick: move |_| todos.modify().retain(|_, todo| todo.checked == false),
|
||||
"Clear completed"
|
||||
}
|
||||
|
|
|
@ -66,7 +66,3 @@ harness = false
|
|||
[[bench]]
|
||||
name = "jsframework"
|
||||
harness = false
|
||||
|
||||
[[example]]
|
||||
name = "rows"
|
||||
path = "./examples/rows.rs"
|
||||
|
|
Loading…
Reference in a new issue