mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-30 11:59:21 +03:00
modal
This commit is contained in:
@@ -10,7 +10,8 @@
|
|||||||
import Toggle from "./widgets/Toggle.svelte";
|
import Toggle from "./widgets/Toggle.svelte";
|
||||||
import Anydata from "./widgets/Anydata.svelte";
|
import Anydata from "./widgets/Anydata.svelte";
|
||||||
|
|
||||||
//import Modal from "svelte-simple-modal";
|
import Content from "./Content.svelte";
|
||||||
|
import Modal from "svelte-simple-modal";
|
||||||
|
|
||||||
import Chart from "svelte-frappe-charts";
|
import Chart from "svelte-frappe-charts";
|
||||||
|
|
||||||
@@ -705,6 +706,9 @@
|
|||||||
<Route path="/about">
|
<Route path="/about">
|
||||||
<Card title={"Пример графика"}>
|
<Card title={"Пример графика"}>
|
||||||
<Chart data={datachart} type="line" />
|
<Chart data={datachart} type="line" />
|
||||||
|
<Modal>
|
||||||
|
<Content />
|
||||||
|
</Modal>
|
||||||
</Card>
|
</Card>
|
||||||
</Route>
|
</Route>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
13
src/Content.svelte
Normal file
13
src/Content.svelte
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!-- Content.svelte -->
|
||||||
|
<script>
|
||||||
|
import { getContext } from "svelte";
|
||||||
|
import Surprise from "./Surprise.svelte";
|
||||||
|
|
||||||
|
const { open } = getContext("simple-modal");
|
||||||
|
|
||||||
|
const showSurprise = () => {
|
||||||
|
open(Surprise, { message: "It's a modal!" });
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p><button on:click={showSurprise}>Show me a surprise!</button></p>
|
||||||
8
src/Surprise.svelte
Normal file
8
src/Surprise.svelte
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<!-- Surprise.svelte -->
|
||||||
|
<script>
|
||||||
|
export let message;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
🎉 {message} 🍾
|
||||||
|
</p>
|
||||||
Reference in New Issue
Block a user