svelte-3 Questions

1

I'm using urql with Svelte and I'm delighted. There is one thing I would like to improve but I don't know how. Many times I have code like this: <script lang="ts"> import { operati...
Dragonhead asked 18/1, 2022 at 12:28

1

I am using svelte-preprocess to compile typescript in my Svelte app. Here is the svelte file: <script lang="ts" src="./component.ts"></script> <template src=&quot...
Fountainhead asked 27/4, 2021 at 4:11

2

Solved

I'm trying to animate this list of Widgets. Of course I can't just animate:flip a component, Svelte needs a DOM element. <!-- invalid --> {#each widgets as widget (widget.id)} <Widget {.....
Premillennialism asked 3/11, 2021 at 22:27

1

Solved

I have several Svelte components and a custom writable store. The store has an init function which is async and which fills the store's value with some REST API's db's table's data. My components m...
Erased asked 8/10, 2021 at 18:56

1

Solved

i wanna to recall the onMount in my Svelte app by clicking some button, but i got this error. Any idea would be amazing, thx :)
Superfine asked 16/7, 2021 at 5:23

2

Solved

I have an input field that I want to hide/show and doing so with a fade and slide transition. I've have two examples that I came up with but both have their drawbacks and I'd like to know if there ...
Scranton asked 3/7, 2021 at 11:41

1

I have the following problem with my svelte project main.ts import App from './App.svelte'; const app = new App({ target: document.body, }); export default app; The first line return a warning ...
Ernie asked 9/6, 2021 at 15:17

2

Solved

I have a react app that uses ContextAPI to manage authentication and I am trying to implement a similar thing in Svelte. In Authenticate.js I have this: import React, { useContext, useState, useEff...
Risner asked 23/5, 2021 at 19:39

1

Solved

If the file test.svelte below is a Page in /routes, it successfully calls load() and populates the template with the JSON array it retrieves when I access it via http://localhost:3000/test. If I mo...
Tchao asked 6/5, 2021 at 16:22

1

Solved

Suppose I have a reusable component called button.svelte, <script> export let text = undefined </script> <button>{text}</button> Now I reuse this component in another comp...
Culver asked 30/4, 2021 at 13:10

1

Solved

Goal I'm creating a button component in Svelte that will either render as <button> or <a> element, depending on whether it's a link or not. Is it possible to use svelte:component? Somet...
Cytoplast asked 26/4, 2021 at 19:10

1

Solved

I'm using SvelteKit (1.0.0) with the node adapter. I want to use it on my server and start it with pm2. What's the best way of starting a Svelte app with a node adapter without npm start? I don't n...
Enabling asked 5/4, 2021 at 22:20

2

Solved

Right now, I have a menu which on click of a hamburger button can be expanded or collapsed. The default state of the menu is true meaning its expanded, but when I go to a different route where the ...
Carmon asked 30/3, 2021 at 19:55

2

Solved

Sveltekit is finally in public beta. Does anyone know how to use it with Tailwind CSS? There aren't any official docs for this integration.
Unemployable asked 25/3, 2021 at 14:34

3

Solved

I want to use Bootstrap (v4.5) in a Svelte (v3) project with custom theme. The bootstrap documentation states that you can do this with scss. So I've setup Svelte with svelte-preprocess as follows:...
Schnabel asked 7/8, 2020 at 10:17

1

Solved

when a child element is clicked the event attached to the parent gets triggered in svelte. I tried the same approach in simple CSS and HTML it worked perfectly whereas in svelte the parent action g...
Cliff asked 1/3, 2021 at 12:50

2

Solved

In Svelte RealWorld App there is something like this: $: query && getData(); This calls REST API when page size or other query parameters change. I have similar situation for listing entit...
Hid asked 1/8, 2019 at 7:38

2

Solved

There is a similar question asked here but I do not believe the answer applies to my use case. I'm using Svelte MaterialUI and attempting to extend the DataTable component with the ability to drag ...
Ulrike asked 10/2, 2021 at 17:9

1

I would like to warn a user to save his changes (form changes)before leaving the page. I want to trigger this alert if he clicks anywhere on the window. It could be the back button or reload or any...

2

Solved

I am trying to build a mobile app with Svelte.js and Ionic v4. 1) I got the svelte-template. 2) Installed ionic with npm install @ionic/core@latest --save. 3) Installed postcss and imported @ion...
Sighted asked 29/10, 2019 at 16:31

2

Solved

Is there a mechanism in Svelte 3 for comparing prop changes inside a component before rendering? Similar to React getDerivedStateFromProps. <script> export let color; // Does anything li...
Berber asked 11/11, 2019 at 21:58

2

Solved

I'm building a Svelte input component which should be usable multible times on the same page. <div> <label>{label}</label> <div> <input bind:value> <!-- some mo...
Goody asked 20/11, 2020 at 10:41

3

Solved

I want to add a head title suffix like - mywebsite on each Svelte page. I'm struggling finding how to do it with ease and simplicity. On the svelte website source, we can see they do it manually:...
Fourpenny asked 29/10, 2019 at 11:13

3

Solved

I wanted to add Styling to the <Link> tag in svelte routing but I couldn't. I have tried to add a class in which there is some styling but it didn't work. <Link to='/' class='link'><...
Olenta asked 26/7, 2020 at 9:0

1

Solved

I'm new to Svelte and it is very likely I'm missing something here. I'm using sveltestrap and svelte-spa-router. When I try creating a <Button> (from sveltestrap) and using the link action (f...
Edaphic asked 10/1, 2021 at 1:33

© 2022 - 2024 — McMap. All rights reserved.