-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doesn't works with Sveltekit #27
Comments
Thanks for reporting the issue. I added a svelte field. |
I'm also experiencing the issue. I installed the beta version you mentioned and got this error: |
Test @egjs/[email protected] version Thank you :) |
@daybrush it fixed the error, thanks! But it still doesn't work properly for me, I can't horizontally drag a scrollable element.. I'm able to drag the scrollbar and use my touchpad to scroll horizontally, but I can't drag: Schermopname.2022-12-26.om.08.44.58.mov |
Test @egjs/[email protected] version Thank you :) https://codesandbox.io/s/jolly-artem-h56p5g?file=/App.svelte |
Thank you so much! It works now :) One more question; can I use multiple of these conveyers on one page? |
thank you |
Updated to version 1.4.7. Nothing has changed from the beta 5 version. Thank you :) |
yes. Declare multiple conveyors. const { ref: ref1 } = useConveyer();
const { ref: ref2 } = useConveyer();
const { ref: ref3 } = useConveyer();
<div class="container" use:ref1></div>
<div class="container" use:ref2></div>
<div class="container" use:ref3></div> |
Hi again, I'm getting the following error when trying to build my site:
Do you know if this is because of egjs-conveyer? I think it is but i'm not sure |
Changed the CommonJS version of @cfcs/core to exports. Test |
Hey @daybrush, I'm back with another question: This is a simplified version of my code: <script>
import { useConveyer } from '@egjs/svelte-conveyer';
const { ref: ref1 } = useConveyer();
const { ref: ref2 } = useConveyer();
const { ref: ref3 } = useConveyer();
const { ref: ref4 } = useConveyer();
</script>
// ... my other conveyers ...
<Lazy onload={() => elementLoaded()}>
<div class="flex avatar-list items horizontal overflow-scroll h-28 -mb-4" use:ref3>
<a href="#" draggable="false" class="aspect-square mr-1.5 w-28 h-28">
<img loading="lazy" draggable="false" class="item" src="image.png" />
</a>
</div>
</Lazy> Do you have an idea on how I can construct the conveyer after the element has been loaded? |
use autoInit option const { ref: ref1, init: init1 } = useConveyer({ autoInit: false });
const { ref: ref2, init: init2 } = useConveyer({ autoInit: false });
const { ref: ref3, init: init3 } = useConveyer({ autoInit: false });
const { ref: ref4, init: init4 } = useConveyer({ autoInit: false });
// after call
init1();
init2(); There is an option called autoInit. Option to block init from onMounted and you can directly call |
hi, i get this error in sveltekit : ReferenceError: Element is not defined
i try to find whats the problem, but i don't really understand. thanks for help |
maybe i'm just dumb, i add the edited: |
CodeSandbox, StackBlitz If you give me an example, I'll check the performance problem. |
@daybrush thanks for the reply maybe i'm just doing something wrong that affected page performace.
|
i've written example code in Sveltekit
`<script>
import { useConveyer } from "@egjs/svelte-conveyer";
const {
ref,
} = useConveyer();
</script>`
<div class="examples">
<div class="items horizontal" use:ref>
<div class="item">1</div>
<div class="item">2</div>
</div>
</div>
i received error message "Function called outside component initialization"
The text was updated successfully, but these errors were encountered: