feat(components): Initialize component state and enable property mapping

- Ensure every component has an initialized state, defaulting to empty.
- Implement property mapping to synchronize states between parent and child components.
This commit is contained in:
Samuel Andert
2023-07-24 15:00:05 +02:00
parent 5b7c49fd58
commit e12f6bcf05
6 changed files with 106 additions and 19 deletions

View File

@ -1 +1,10 @@
<div class="p-12 bg-blue-400">Hello Earth</div>
<script>
export let id;
import { getComponentStore } from '$lib/stores/componentStores.ts';
const store = getComponentStore(id);
$: console.log('store:', $store);
</script>
<div class="p-12 bg-blue-400">Hello Earth {JSON.stringify($store)}</div>