onSSR allways make my api call
hi, in my application, i create alert message, who must appears on the first loading of a page. I using onSSR() on the default.vue, but when i change the page, it reloading my alert message. I try to using onServerPrefetch, but same result.
What i'm doing wrong? It is the best way for what i want to do ?
4 Replies
Hi @Keider π , I need to understand your goal to help you. What is it exactly that you're trying to achieve? What should it do. What is it doing that you don't expect? π
Sorry,
i work with sylius, i request to get my objet, and display it in an SfModal. i make my request in default.vue with method onSSR. My goal is when a user go on my app, he get this modal once. ( a welcome message for exemple). My problem is when i change page the modal reappears.
Is it more clear ? sorry for my english.
No worries, I think I understand. I think you can copy the example from the LoginModal on the same page. You need to set the state when the user closes the model, so it doesn't reappear:
![No description](https://cdn.answeroverflow.com/1161304447838867556/image.png)
![No description](https://cdn.answeroverflow.com/1161304448107298867/image.png)
![No description](https://cdn.answeroverflow.com/1161304448346357760/image.png)
Thank you very much for this,