New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPA Routing Brand Header & Navigation #1167
Comments
Hi @TFlaxx, thanks for getting in touch and asking. Using framework components, e.g. (In other Scale components like the Sidebar Navigation, it is already possible to use framework components for links.) However, navigating programatically, e.g. You can have the regular <scale-app-header @click="handleLinkClick">{/* ... */}</scale-app-header> methods: {
handleLinkClick(event) {
event.preventDefault(); // avoid native browser navigation
try {
// you could check target is actually an `<a>` tag here
const url = new URL(event.target.href);
this.$router.push(url.pathname);
} catch (err) {
// ...
}
}
} Is something like this what you're currently doing? |
After a couple days of research we found a solution which we will use for now. In our setup, we we're not able to use an object as This is a lazy-loading vue3 issue, see here But: Building Telekom Scale with Our fix for using the SPA router inside the ScaleAppShell with vue3:
|
Thanks for the feedback @TFlaxx — this is a great finding. Stencil can have many output targets, so besides to
definitely, we will then replace the deprecated I'm closing assuming you've been able to solve the issue. Feel free to re-open if not, or keep the conversation going. Any feedback is valuable. |
Scale Version
v3.0.0-beta.110
Framework and version
vite: 3.0.1
vue: 3.2.37
Additional context
Is there any way to have a SPA friendly way of navigate?
Using some hacky js in the href-tag, as we tried, isnt really best practice.
The text was updated successfully, but these errors were encountered: