2

I'm trying to use vue-router 3 instead of vue-router 4 in Vue JS 3. It is possible?

Using @3 instead @next I have the same problem as here:

Vue3 "export 'createWebHistory, createRouter' was not found in 'vue-router'

2 Answers 2

2

Why would you do that? They built v4 for Vue3: https://github.com/vuejs/vue-router-next

Version 3 was for Vue2.

The features should be the same.

Sign up to request clarification or add additional context in comments.

Comments

0

The motivation I was trying to fall back to an older version was because I found in a tutorial a very difficult way to use for '*'. A lot of lines of code and regex complexity. Believed that using that way isn't easy and natural. I'm a backend dev and in Python Flask it somehow easier and clear like in Vue JS 2

After digging and digging and digging (I don't understand why the show more complicated way like "router.resolve", etc) I found the this way

{ path: "/:catchAll(.*)", redirect:"/" } .

As a side note as a new Vue JS developer I just found that there are more functions to catch paths:

catchAll, pathMatch, noPage (I will study to understand the difference).

The page that enlighted me was: Vue Router - catch all wildcard not working

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.