svelte Questions
13
Solved
Is there any direct option to persist svelte store data so that even when the page is refreshed, data will be available.
I am not using local storage since I want the values to be reactive.
Hogback asked 7/6, 2019 at 5:0
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
2
It appears that goto in SvelteKit does not do anything when it is instructed to redirect to the current webpage:
<script>
import { goto, invalidate } from '$app/navigation';
function reloa...
1
Solved
I would like to define my custom component and specify which kind of "standard component" I would to extend.
This to consume VSCode intellisense for all standard attributes of the extende...
Holohedral asked 5/4, 2021 at 20:21
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 ...
2
Solved
I am using +layout.server.ts to redirect unauthenticated users from accessing authorized routes with this code:
/* +layout.server.ts */
export const load: PageServerLoad = async () => {
// ......
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
4
Solved
I come from the world of JavaDocs and love the DX of working on a thoroughly-annotated application after a certain level of complexity.
Being able to hover over and peek all the props (and implie...
Lucier asked 1/6, 2020 at 3:48
1
Solved
In the CSS section of a Svelte file, suppose I use a background-image:
div { background-image: url(img/bg.jpg); }
The image file is in the static folder (static/img/bg.jpg). This simple example ru...
3
I just got a really unexpected bug in my sveltekit application and I can't find anything online talking about it
I have a normal sveltekit application but instead of hydrating the new code when nav...
Rna asked 21/11, 2021 at 0:45
3
Solved
I'm new in Svelte and I'm trying to set some info into sessionStorage but it is throwing "sessionStorage is not defined".
I realised that I received this error because it's running on the server si...
2
Solved
I want the result to be like this
but this is what i get
with my svelte code:
<div
style="background-image: url('{unsplash?.url}');"
class="bg-black flex items-center justify-...
Semitics asked 16/4, 2022 at 17:56
1
Solved
I am deploying sveltekit to a dfinity container and I need to disable minification to debug.
I have to build a static version to deploy it with npm run build -- is there a vite option to disable mi...
2
Solved
I want to read the body of a request in my hooks.server.ts
import type { Handle } from '@sveltejs/kit';
export const handle = (async ({ event, resolve }) => {
console.log(event.request.body);
...
Dulcie asked 10/1, 2023 at 14:22
6
Solved
How should I access the the query string parameters from svelte? I'd like my script to behave differently when "?beta" has been appended to the URL.
My intuitive approach would be to use ...
Bronchial asked 15/3, 2021 at 12:3
1
I believe Solid and Svelte work pretty much the same way, using reactive graphs for calculations.
The difference is that Solid does it in explicit way, using functions, and Svelte does the same thi...
1
Solved
When you look at this code:
<script lang="ts">
import RedThing from "./RedThing.svelte";
import GreenThing from "./GreenThing.svelte";
const things: Record&l...
Cristinacristine asked 16/3, 2023 at 8:7
4
Solved
I have the popup modal in one of my app. I would like to close this popup while clicking outside of modal. I can achieve this behaviour using JavaScript but I can't quite find a way to make this wo...
Aulos asked 12/3, 2018 at 4:18
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
Creating a web component using svelte, I need to run some code when an attribute of the component is changed.
What I have come up with is the following pattern.
<script>
export let test ...
Gantt asked 17/9, 2019 at 14:52
1
I'm looking for an way to mock/stub stores that are used in Svelte components, specifically with the auto-subscribe syntax (ie $myStore or $myStore.property).
I've tried a couple of different mocks...
Whisk asked 20/11, 2021 at 0:15
2
I'm trying to connect my postgres database to my web app. Per this post, I have my hooks.js connection set up like so:
export const handle = async ({event, resolve}) => {
event.locals = {
user...
Selfeffacing asked 30/5, 2022 at 23:47
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
2
Installed with $ npm install @picocss/pico -D
in rollup.config.js:
import css from "rollup-plugin-css-only";
...
plugins: [
css({ output: "static/bundle.css" }),
],
In ./r...
Metaphrase asked 31/1, 2022 at 20:3
4
Solved
As the title suggests, I am trying to pass a method from a parent component to a child component.
For example,
App.html
<div>
<TodoItem
done={todo.done}
toggle={toggle}
/>
</div&...
Kelcie asked 5/6, 2018 at 14:30
© 2022 - 2024 — McMap. All rights reserved.