I basically need to be able to trigger something within one or more components (that are being dynamically added via svelte:component) when an icon/button within the parent component is clicked. e.g. I need to hook the parts denoted with ** below:-...
I need to redirect users to login page if they are not authenticated. I need something like route.beforeEach in Vue.js, ideally: sapper.beforeRouteChange((to, from, next) => { const isAuth = "[some session or token check]"; if (!isA...
I'm trying to implement a fairly standard blog app using Svelte, Svelte Routing and Firestore, but I think I'm misunderstanding a fundamental part of how props are passed between components. I based my initial code on the excellent tutorial...
I came across the following valid syntax in JS when looking at svelte library: $: doubled = 6 * 2; At first, I thought it was specific for the library, but it works on the Chrome console. What is this syntax? It can be anything: name: something...
I haven't found this feature anywhere in svelte 3.. I want it to be something like this.. App.svelte <Error> <p>Can't connect to the server!</p> </Error>` Error.svelte <div>{props.children}</div> I...
I am working on creating a multi-step form using Svelte.js but I've run into an issue rendering each form page with unique props. Here is a simple demo to show you what I mean: // App.svelte <script> import FormPage from "./FormP...
I am trying to add some styling to an HTML tag rendered inside of the {@hml...} tag of a Svelte component, but it appears that it only inherits the parent's styling (the container of the {@html...} tag). Moreover, the Unused CSS selector error po...
If SvelteJS compiles everything in your code to plain JavaScript does this mean that third-party libraries' code will also be converted to plain JavaScript and remove the ever so problem of npm modules vulnerabilities for JavaScript frameworks,...
I created a new svelte project, opened the new directory in visual studio code and when I run npm run dev in the terminal and open my web browser, the project I see isn't the one I just created its one I previously worked on. So my initial reac...
I've decided try out Svelte for my next website, and this will be a static website hosted using GitLab pages. I got the basic compilation working which generates dist/bundle.js and dist/bundle.css. The issue is that I cannot upload this dist fo...
©2020 All rights reserved.