Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1736

How to have multiple pages/layouts under the same endpoint in Svelte?

$
0
0

I will preface this question by stating I am not a frontend developer.

I am developing a pet project, where I have a form, and when the form is submitted, the user advances to the next "stage".

For example, a user fills in some basic info, uploads a file, and then in the next page I render the info that the user filled in. I would like all of this to happen under the /app endpoint.

How does this look like in practice? What's the proper way of developing a page that has multiple "pages" so to say? What are the appropriate terms so I can google more about this?

Right now I have something that looks like this, but I really dislike it.

<script>  let currentStep = 0;  let maxSteps = 3;  function handleNextStep() {    if (currentStep < maxSteps) {      currentStep++;    }  }</script>{#if currentStep === 0}<Form nextStep={handleNextStep} />{:else if currentStep === 1}<Render nextStep={handleNextStep} />{:else if currentStep === 2}<App />{/if}

The problem with this is that if I refresh the page I will lose the "progress", and overall it doesn't look good I think.


Viewing all articles
Browse latest Browse all 1736

Trending Articles


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>