Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Browsing all 1539 articles
Browse latest View live
↧

Using MathJax in a Svelte Project

I'm attempting to use MathJax in a svelte project. The problem I'm facing right now is that typescript will return an error when I try to use LaTeX functions, such as \matcal{Q} or \color{red}{Q}, the...

View Article


Sveltekit not able to retrieve URL query params

I've got a page (routes/customers/+page.svelte) in which I've got two buttons:<div class="float-right block p-5"><button on:click={() => addNewCustomer("individual")} class="btn btn-sm...

View Article


SvelteKit navigation delayed by await

I have a component that loads some data asynchronously and displays it. There are also ways to navigate to different pages from that component. However, the navigation only happens after all #await...

View Article

SvelteKit store undefined when accessed from a different component

I'm attempting to set a store within one Svelte component and access it another. I immediately log the store after setting it (in Component.svelte), and it's what I expect however my reactive statement...

View Article

Open a modal inside an element in an {#each ... } loop

Problem: Every time I open the modal in one of the child components in the loop it always opens the modal in the last element of the loop. I cannot make it open the modal of the other child elements...

View Article


How i can fetch session data?

I try to fetch some session data using a svelte frontend and i get a response status 401This is the code that i use for the corsrouter.Use(cors.New(cors.Config{ AllowOrigins:...

View Article

SvelteKit: Slug Route within a Group Route

I have this SvelteKit directory setup: routes/(main)/vergabeassistent.Within that directory I have:+page.svelte[slug]/+page.svelteCalling localhost:5173/vergabeassistent works fine and is a list view....

View Article

Slider that translates content in and out of container based on slider x-axis...

I'm working on a slider that has 4 stages of content. I am trying to translate the content in and out of the container based on the slider's position on the x-axis. I need the content to move with the...

View Article


How to pass a component as a prop in another component in svelte

I have 2 components - Slider Component and Button ComponentFollowing is the Button component<script> export button_type, custom_class, clickHander;</script><button type={button_type}...

View Article


Tween y coordinates of SVG path to animate chart transitions dynamically

I'm dynamically drawing an SVG path based on a data array (think linechart).Would love to animate the chart transition when the data changes but this only makes sense for the Y values in my case.The...

View Article

Is it possible to render svelte component's (end result) HTML code as a...

I have a simple PrimaryButton.svelte component that contains "HTML" only (no script or style tags) and looks like this:<button class="btn-primary btn accent--br">Primary button</button>Then...

View Article

Laravel redirect to causes "All inertia requests must receive a valid Inertia...

Using Laravel 11 with InertiaJS and Svelte.I have an admin.php file which has some routes guarded by the auth middleware. I want the "/admin" route to redirect to /admin/posts, or /login if the user is...

View Article

Markdown in Svelte with links needing target attribute and using the...

So, we have a Svelte component that uses the svelte-markdown package to render Markdown into readable text on the frontend, which works great until it comes to rendering links. I need to always have...

View Article


On click event is not bubbling past the shadow root in unit tests

I have a svelte component in a shadow dom structure. It's a part of a group of radio buttons, and when a user clicks on a radio button, it triggers a callback function that takes the event as an...

View Article

npm run dev updating CSS on macOS, not on Windows

"npm run dev" updates on my macOS when I make changes in my stylesheet, however on Windows it only updates my html.I tried clearing my cache, installing "npm cross-env" tool, and installing latest...

View Article


Using OpenAI on a vitual enviroment via node.js

I've wanted to try my hand into working with AI and opted to try OpenAI or Olama. I'm currently using Sveltekit to create my website. I've followed a few courses where they used a virual enviroment...

View Article

Typescript not parsed in Svelte html section

I'm working on a Svelte project, configured to use typescript.For every element in the datesToShow array, a div should appear in the DOM. This is done with the code shown bellow.{#each datesToShow as...

View Article


Can you add optional _outer_ tags in svelte conditional statement?

Is it possible to use a conditional statement to wrap inner content with an optional outer element?Here is an example of what I want to do in valid Svelte:<script> export let...

View Article

Making expandable buttons using Svelte

I'd like to make expandable buttons using svelte, each button's name enlarging as a headline and popping up its content on click.I've been looking into svelte components, but none of what I've found so...

View Article

How do I pass the value of a store as a prop in Svelte, where the store is an...

Suppose I have a list of items with Svelte stores as members, e.g.:interface Item { isAvailable: Writable<boolean>;}If I have some component with a boolean prop, how do I pass values from those...

View Article
Browsing all 1539 articles
Browse latest View live