Hi,
Relatively new to Ixon and web development. Trying to build some custom components in Svelte, I’m able to import js libraries no problem.
<script>
export let context;
import dayjs from 'dayjs'; //works
//import Button from './Button.svelte';
const today = new Date();
const tomorrow = dayjs().add(1, 'day').toDate()
</script>
<main>
<h1>Hello World {today}</h1>
</main>
<style>
main {
text-align: center;
padding: 1em;
max-width: 240px;
margin: 0 auto;
}
h1 {
color: #ff3e00;
text-transform: uppercase;
font-size: 4em;
font-weight: 100;
}
@media (min-width: 640px) {
main {
max-width: none;
}
}
</style>
What I have been trying to do is import components in .svelte files and libraries for use in my custom component. I would like to build a heat map (like github’s commit thing).
As soon as I remove the comments from //import Button from './Button.svelte';
the component no longer renders in the simulation.
The contents of Button.svelte would be
<button>A button</button>
Then places in Main with
<Button/>
I know this is possible in svelte, but I do not know how Ixon has implement it and the components. Would anyone have any guidance?