mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-22 22:09:22 -05:00
✨ feat: modal add close icon
This commit is contained in:
parent
c51f220ed0
commit
c43091de76
3 changed files with 4 additions and 2 deletions
|
@ -17,6 +17,7 @@ leptos = { version = "0.2.4", features = ["stable"] }
|
|||
stylers = "0.3.1"
|
||||
web-sys = "0.3.61"
|
||||
leptos_dom = { version = "0.2.4" }
|
||||
leptos-icons = { git = "https://github.com/Carlosted/leptos-icons.git", features = ["AiCloseOutlined"] }
|
||||
|
||||
[workspace]
|
||||
members = ["examples/basic"]
|
||||
|
|
|
@ -11,7 +11,7 @@ pub fn DemoModal(cx: Scope) -> impl IntoView {
|
|||
<Button on:click=move |_| set_open.update(move |value| *value = !*value)>
|
||||
"open modal"
|
||||
</Button>
|
||||
<Modal title="" open=open on_cancel=on_cancel>
|
||||
<Modal title="标题" open=open on_cancel=on_cancel>
|
||||
"sd"
|
||||
</Modal>
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ use crate::teleport::*;
|
|||
use crate::utils::mount_style::mount_style;
|
||||
use leptos::*;
|
||||
use stylers::style_sheet_str;
|
||||
use leptos_icons::*;
|
||||
|
||||
#[component]
|
||||
pub fn Modal(
|
||||
|
@ -30,7 +31,7 @@ pub fn Modal(
|
|||
cx,
|
||||
<>
|
||||
<span style="cursor: pointer;" on:click=move |_| if let Some(on_cancel) = &on_cancel { on_cancel.set(())}>
|
||||
{ "x" }
|
||||
<LeptosIcon icon=AiIcon::AiCloseOutlined/>
|
||||
</span>
|
||||
</>
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue