onBeforeRoute+vue-router disable <a> handling, #1973
Unanswered
hlpmenu
asked this question in
Help & Questions
Replies: 1 comment 2 replies
-
Regarding Vue Router, see https://vike.dev/vue-router. In other words: why do you want to use Vue Router instead of Vike's built-in router? Regarding customizing filesystem routing it's a non-goal because we believe convention is more important than frivolous preference. Feel free to disagree. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Im working on a nuxt-like setup using vike+vue+vue-router, but have ran into a small, but weird issue, that i cant find a solution for, and dident get a answer for on discord.
Setup
Routes
Custom implementation of file based routing, working just like Nuxt.
Ie:
Problem
Using
Will instantly init a new instance of the app, due to being caught by vikes href handling.
using:
Ofc works, but as the normal workflow would be == non SPA navigation, having to add the external attr to it is not ideal.
Code
Simplified example of onBeforeRoute:
Dummy { route } +route.js:
Simplified onRenderHtml:
onRenderClient:
Similar to onRenderHtml, but client
app.js(createApp & createClientApp)
Basically just this with some client/ssr specific things within both:
router.js
Rest is not relevant for this issue, but i will add it here, if needed.
Beta Was this translation helpful? Give feedback.
All reactions