mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 23:12:34 +03:00
modal
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
import Toggle from "./widgets/Toggle.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";
|
||||
|
||||
@@ -705,6 +706,9 @@
|
||||
<Route path="/about">
|
||||
<Card title={"Пример графика"}>
|
||||
<Chart data={datachart} type="line" />
|
||||
<Modal>
|
||||
<Content />
|
||||
</Modal>
|
||||
</Card>
|
||||
</Route>
|
||||
</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