svelte-3 Questions

3

Solved

I'm using Typescript inside my svelte project, I need to define strong type for my event. But I can't find any way to do that. <script lang="ts"> const onKeyUp = (event: [type here...
Lucarne asked 19/11, 2021 at 7:19

7

Solved

I'm using clickOutside directive on my svelte-typescript project and I'm getting this error when I assign custom event to the related element Type '{ class: string; onclick_outside: () => boolea...
Greylag asked 30/9, 2020 at 4:59

4

Using @sveltejs/adapter-node: 1.0.0-next.61 and @sveltejs/kit: ^1.0.0-next.225 The following issue occurs only on the build version of the app, and not on the dev server, on which it doesn't occur....
Shivers asked 22/3, 2022 at 9:0

4

Is it possible to reverse the order in which the items are displayed in svelte's {#each ...} block? I want this for an array of object, sorted by id, where the oldest entry comes first. And I want...
Gastronomy asked 18/12, 2019 at 13:59

4

Solved

I'm trying to the /login?ref=/some/path parameter to redirect to after login: const ref = $page.url.searchParams.get('ref') || '/dashboard'; However I get this error: TypeError: Cannot read proper...
Cureton asked 7/3, 2022 at 9:39

4

It seems that Tailwind CSS IntelliSense is not working every time I start VScode , after reinstalling it works, on the other hand when it works Tailwind CSS IntelliSense is not suggesting unless I ...
Outstretch asked 6/1, 2022 at 4:56

5

Solved

I'm hoping to find a way to iterate over an #each block a set amount of times in Svelte 3. In Vue I would do something like this: <li v-for="i in 3"><!-- somecontent --></l...
Cabinet asked 3/10, 2019 at 6:41

1

I'm working on an app that renders a tree structure graphically. There are various node types in the tree, each with a corresponding Svelte component which renders it. One of the features of the ap...
Adin asked 29/8, 2021 at 5:14

5

Solved

I don't understand this section in the tutorial: https://svelte.dev/tutorial/keyed-each-blocks. I can see the things array is updated correctly so the right thing.color is passed as expected. But b...
Jutta asked 21/6, 2020 at 13:37

3

Solved

I have created a svelte app and building app using SvelteKit everything is works fine. I tried to deploy this app in firebase hosting but it fails. Sveltekit generating production build under .svel...
Pickar asked 8/8, 2022 at 18:23

3

Solved

I don't know how to type Svelte 3 reactive syntax variables. <script lang="ts"> import type { Player, Team } from "./types"; import { DEFAULT_PLAYER } from "./util...
Petropavlovsk asked 2/6, 2021 at 10:13

3

Solved

I'm working on a component and i need to use context for it. But i don't know why when i using getContext, It's undefined. This is a part of my codes on first component (Index Component): import { ...
Monarch asked 3/8, 2020 at 9:22

2

Solved

I have doubts about how to create a Custom element API. I have followed the documentation, but I get the following warning: The 'tag' option is used when generating a custom element. Did you forge...
Atherosclerosis asked 4/3, 2020 at 15:6

3

Solved

I have tried rendering the html by storing the html in a variable but it is not working , I also tried the triple curly braces <script> let name = 'world'; let val = "" let ans2 ...
Jasminejason asked 20/8, 2019 at 18:58

2

Is there any rollup.js plugins which allow to obfuscate / mangle CSS class names? I haven't found anything, except this one for webpack: https://github.com/sndyuk/mangle-css-class-webpack-plugin
Styx asked 18/8, 2020 at 5:3

1

Solved

I am making a web component in Vanilla JS that use a hidden select in the background and a div and ul>li in front. It became a bit complex with fetching data from an api, ect, so I transitioned ...
Alliteration asked 24/3, 2023 at 10:42

2

Solved

https://tailwindcss.com/docs/background-image#arbitrary-values this is how I want to use Tailwind bg-image feature. This does not work using SvelteKit next 160 and Tailwind 3.0.9. Code: <script&...
Sprue asked 4/1, 2022 at 22:13

2

Solved

I'm working on a table component which one will be usable (included in a library when it will work correctly)in any of my projects. As there is a lot of css rules related to this component I would ...
Stein asked 29/12, 2021 at 16:35

4

Essentially I'm working on a slideshow project where each "slide" is loaded dynamically using <svelte:component this={currentSelection.component} />. Each slide requires custom in and out tra...
Boysenberry asked 26/1, 2020 at 14:50

7

I am trying to build an SPA with role based access using Svelte. Coming from Angular with its route guards, I want to setup something similar. What would be the best way to do that? EDIT: I was ind...
Oberammergau asked 3/7, 2021 at 16:59

2

Solved

I need to run a Svelte app and be able to execute it without a server. With other frameworks this is possible as it is just javascript but I can't find a way to just click my index.html and run my...
Eyla asked 23/5, 2020 at 1:9

4

I am a newbie on Svelte and in coding in general. I'd prefer to learn SvelteKit (Svelte@Next) rather than sapper since that seems to be where Svelte is heading. For my personal project, I need to s...
Tarsia asked 28/1, 2021 at 2:44

3

Currently, I'm working on a project which shares a Menu component across all pages except two pages. I added the menu component inside root _layout.svelte file. Now since two pages that don't need ...
Cryobiology asked 3/11, 2019 at 8:9

4

Solved

I can't find any example anywhere online that shows how to (or if we can) output a single HTML file from a Svelte project using Rollup (not Webpack), containing all CSS and JS injected inline (and ...
Salesmanship asked 2/5, 2020 at 19:38

4

Solved

One of my components is subscribed to a variable in a store. Whenever there is a change in that store var, I want to trigger a function. stores.js import { writable } from "svelte/store"...
Myronmyrrh asked 16/11, 2020 at 13:25

© 2022 - 2024 — McMap. All rights reserved.