From b167e40f8d156f40234e1467a65df6dece89fcf8 Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko Date: Sat, 14 Aug 2021 17:37:43 +0000 Subject: [PATCH] passing data from component to main code --- src/App.svelte | 8 +++++++- src/Input.svelte | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/Input.svelte diff --git a/src/App.svelte b/src/App.svelte index cbb054c..3386ed5 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -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); //
@@ -141,7 +144,10 @@ - + + +

{text}

+
diff --git a/src/Input.svelte b/src/Input.svelte new file mode 100644 index 0000000..a220bee --- /dev/null +++ b/src/Input.svelte @@ -0,0 +1,20 @@ + + +
+
+
+ +
+
+ +
+
+
\ No newline at end of file