211 questions
0
votes
3
answers
61
views
How to conditionally change the component or paths in routes based on a value stored in pinia store?
How can I dynamically change the path and components in the routes, based on a value from pinia store?
I tried to check the condition in the routes, I get an error:
store was accessed before it was ...
0
votes
0
answers
24
views
Vue 3 Payment Success Page API Called Twice in Production After Stripe Redirect
I'm building a Vue 3 SPA with Vuex and Vue Router. On my Payment Success page, I call an API to assign purchased drinks:
created() {
this.buyDrink()
},
methods: {
buyDrink() {
const payload = ...
0
votes
0
answers
64
views
TypeError: u.then is not a function in Vue3+Vue router
Console Error
TypeError: u.then is not a function
at index-CyodobdF.js:26:14273
at Object.runWithContext (index-CyodobdF.js:14:10931)
at we (index-CyodobdF.js:26:19934)
at index-...
0
votes
0
answers
36
views
Why won't data persist in a component that is reused?
I have a Vue component that is rendered on a route like this:
{
path: '/chat/:Username(\\w+)?',
name: 'ViewChat',
component: Chat
}
The Chat.vue component should render at the path /chat and ...
1
vote
0
answers
43
views
Vue router named view is not rendering
I am new to vue 3 and stuck at a point where I have two divs side by side and I want to show the component in the right div.I read the router documentation and tried to solve it but not succeeded. ...
2
votes
2
answers
752
views
Vue router gives a warning when adding dynamic route: No match found for location with path "/test"
I add a route dynamically and it works but I get the warning below.
"No match found for location with path "/test".
Code Sandbox demo url.
https://codesandbox.io/p/github/eguvenc/...
0
votes
1
answer
203
views
Vue Router not finding query params
Vue 3, Vue Router 4, web hash history router
I have a url with a query param that gets inserted, but Vue seems to ignore it and it's causing weird redirect issue for my application.
For example:
Is: ...
1
vote
1
answer
249
views
beforeEnter navigation guard not triggering when router.push() is called on the same route
I have a search engine which is not properly updating when after having searched something, I try to search something else.
When I want to search something, the search function in the search component ...
0
votes
0
answers
95
views
Vue.js 3 Composition API cannot pass router parameters
Get parameters from vue-router 4 with composision API vue.js 3 doesnt seem to work, its was easy on vue.js 2 before,
anyhow heres my code
import { ref, onMounted } from 'vue'
import { ...
0
votes
1
answer
336
views
Vue Router does not update the path in the address bar
I'm using "vue": "^3.4.21" and "vue-router": "^4.4.0"
main.ts
import { createMemoryHistory, createRouter } from 'vue-router'
# ...
const app = createApp(App)
...
0
votes
1
answer
67
views
Best way to implement conditional tabbed routing in vue
What I'm trying to implement is routing with tabs where the available tabs change depending on the user type (upon authentication the user type gets stored in a pinia store).
This is what I ended up ...
0
votes
1
answer
149
views
Vue3 + i18n-vue Override language detection?
I'm using vue3 with i18n-vue with language prefix. i18n-vue provides language detection (probably using browser language). How do I add custom detection?
eg) when a user hits /, i18n performs language ...
1
vote
1
answer
257
views
Vue 3 Router issue, no outlet, no displayed content
I have a vue3 application which works perfectly fine when embedding all packages in the directly (locally) in the output bundle.
package.json
"vue": "^3.4.29",
"vue-router&...
1
vote
1
answer
104
views
Escape colon in Vue router wikipedia-style
Context
I've been trying to replicate what wikipedia does with their URL
It works something like
/[Namespace]:[PageName]
/[PageName]
So if I go to /randompage I get as params:
namespace: ''
page name:...
1
vote
1
answer
115
views
Vue-Router render the component but doesn't change the url
import { createMemoryHistory, createRouter } from "vue-router";
import { AuthUser } from "../../auth/user";
const routes = [
{
path: "/",
component : () => ...