mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 23:12:34 +03:00
passing data from component to main code
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
router.mode.hash(); // enables hash navigation method
|
||||
//router.mode.memory(); // enables in-memory navigation method
|
||||
import Card from "./Card.svelte";
|
||||
import Input from "./Input.svelte";
|
||||
let text = "";
|
||||
const handleChange = value => (text = value); //
|
||||
</script>
|
||||
|
||||
<main>
|
||||
@@ -141,7 +144,10 @@
|
||||
</Route>
|
||||
|
||||
<Route path="/test">
|
||||
<Card title="Test section" />
|
||||
<Card title="Testing card">
|
||||
<Input onChange={handleChange} title="Input text" />
|
||||
<h1>{text}</h1>
|
||||
</Card>
|
||||
</Route>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user