svelte-3 Questions
1
Solved
I am trying to build an app with Svelte and TypeScript using Rollup and when I try to build my Svelte components I just can't seem to make it compile my .ts files that are included from a .svelte c...
Eternal asked 22/12, 2020 at 23:33
1
I am new with Svelte and trying to import some package.
After the npm install, I import it directly into my svelte file:
import jspdf from "jspdf"
that got me the error:
Error: UMD and ...
Marieann asked 4/11, 2020 at 11:49
5
I would like to have something like this made possible:
<div
class="overflow-scroll h-screen antialiased ..."
class:whiteTheme="bg-gray-100 text-gray-800 ..."
class:darkTheme="bg-blue-900 ....
Woodrow asked 28/1, 2020 at 2:57
1
Solved
I am trying to load sv-bootstrap-dropdown module in nav.svelte component but I am getting the error <Dropdown> is not a valid SSR component. You may need to review your build config to ensure...
Lacroix asked 22/11, 2020 at 17:43
2
Can you help me understand what's the difference here between these two components:
REPL: https://codesandbox.io/s/svelte-onmount-or-not-yhu91
With onMount:
<script>
import { onMount } ...
Miserere asked 3/5, 2020 at 16:7
3
Solved
I am a bit confused here and unluckily I couldn't get any solution on the discord channel of svelte so here I go...
I have a rather basic example of two classes, let them be App and Comp.
App creat...
Tarlatan asked 17/9, 2020 at 8:52
3
Unlike onMount there is no beforeMount lifecycle event in SvelteJS. So, how do we fetch data that the page depends on before mounting? onMount fetches produces glitches. One can say that I can wrap...
Caprice asked 29/10, 2019 at 9:47
1
Is there an easy way to force a restart of Svelte components in place?
Restart use cases:
Clear file list of HTML files input (you cannot reset the path / value)
Nav bar dropdown collapse after ...
Tiga asked 29/9, 2019 at 8:52
1
Solved
I'll try to be brief.
I'm having the main component app.svelte. Inside it I'm using a child component called Course.svelte. I'm using an {#each} block to repeat the same component many times. The t...
Bassist asked 1/9, 2020 at 23:45
2
Solved
When i'm trying to change data dynamically of the each loop variable is not refreshing the DOM elements. How I can redraw the each loop values
<script>
// default messages object
let messag...
Jeffryjeffy asked 12/8, 2020 at 7:45
2
Is there a way to bind object field in Svelte 3?
Example:
<script>
import MyComponent from "./MyComponent.svelte"
let myobjectID
</script>
<MyComponent bind:myobject[id]...
Manciple asked 4/8, 2020 at 17:43
1
Solved
I'm quite new to svelte and I'm trying to get a canvas to render on the full screen using svelte. Sounds quite easy to do, but I can't get it to work properly. I'm binding a width and height variab...
Enjoyment asked 31/7, 2020 at 13:28
3
Solved
Relevant REPL
I have a simple writable store with a custom set method:
import { writable } from 'svelte/store';
function createState() {
const {subscribe, set, update} = writable({a: 0, b: 0});
r...
Humphries asked 22/7, 2020 at 6:2
3
Solved
I want to receive arbitrary props from "above" and spread them onto an <input>, as shown here where inputProps would become an object containing any additional props set on this component (si...
Tenaille asked 17/12, 2019 at 4:57
3
Solved
I have a main application that contains the user object and the login component
<script>
let user = {}
</script>
hello {user.username}
<login user={user} />
In the login compone...
Procrustean asked 10/7, 2020 at 19:51
3
With the following code:
<svelte:head>
<script type='application/ld+json'>
{
"@context": "https://schema.org",
"@type": "Organization",
"url": "https://filestar.com",
"logo": "ht...
1
Solved
Say I render the following Dialog:
let dialog;
<MyDialog bind:this={dialog}/>
I want to position this dialog (using afterUpdate lifecycle function I guess). However, dialog is not a dom e...
1
Im trying to add the asYouType function from libphonenumber-js to my svelte input using an onChange handler as I'm not sure how this can be done with 2 way binding.
I have managed to implement thi...
Periclean asked 9/6, 2020 at 8:43
2
Solved
What I need is to use async-await in Svelte onMount().
Or maybe you can suggest me what is wrong and what I can use alternatively.
To Reproduce
go here: https://svelte.dev/repl/000ae69c0fe14d94...
Semibreve asked 29/5, 2020 at 13:25
1
Solved
How to get store value from another store?
https://svelte.dev/repl/0ab80c2fb8e045958d844bd4b11c04a9?version=3.22.1
In the example I include a variable inputVal in stores.js file and changing in
se...
Godewyn asked 4/5, 2020 at 4:55
1
Solved
I have setup svelte-preprocess so I can do this successfully:
<script lang="typescript">
let someConstant:string = "some constant";
console.log({someConstant});
</script>
That work...
1
Solved
Here is the warning I get when I compile a component with an img that lacks an alt attribute:
Plugin svelte: A11y: <img> element should have an alt attribute
All developers will agree A11y...
Cyb asked 17/4, 2020 at 13:19
2
Solved
(I'm new to Svelte so it is quite likely that I'm doing something wrong here)
UPDATE: I've added a second, slightly different REPL which may demonstrate the problem better. Try this one: https://s...
Chronopher asked 24/3, 2020 at 5:45
1
Solved
Say I have a blog route that loads a complete array of all blog posts. The individual blog posts live at blog/[postId]. Is there a Sapper-idiomatic way to pass the data for the individual post from...
1
Solved
I'm having a tough time making a tooltip that runs off use:action. My requirements are:
Create a tooltip with HTML or a Component as the content
Without having to wrap a component in a <Toolti...
© 2022 - 2024 — McMap. All rights reserved.