You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I had difficulty to get it to work with the Sveltekit, after some research found a solution.
if it's acceptable please include it in the docs, so other people can use it.
<script>importdatafrom"./states.js";import{onMount}from'svelte';letTypeahead;onMount(async()=>{constmodule=awaitimport("svelte-typeahead");Typeahead=module.default||module;});letevents=[];</script>{#if Typeahead}<svelte:componentthis={Typeahead}label="U.S. States"placeholder={`Search U.S. states (e.g. "California")`}{data}extract={(item)=>item.state}disable={(item)=>/Carolina/.test(item.state)}
on:select={({ detail })=>events=[...events,detail]}
on:clear={()=>events=[...events,"clear"]}/>
{/if}<pre>{JSON.stringify(events,null,2)}</pre><style>:global(input){margin: 0;}</style>
The text was updated successfully, but these errors were encountered:
Hi,
I had difficulty to get it to work with the Sveltekit, after some research found a solution.
if it's acceptable please include it in the docs, so other people can use it.
The text was updated successfully, but these errors were encountered: