Problem reloading page that has parameter in Vue

Asked

Viewed 18 times

0

Sometimes it is necessary to send a parameter through a route

In my case it’s happening like this:

When my route (URL) has no parameter, I can press the F5 key and the page loads normally.

But when the route has some parameter localhost:8080/path/1, after pressing and if there is a need to press the F5 key

I have these mistakes:

Refused to apply style from 'http://localhost:8080/editar/vendors.fdbbeba1.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
11:1 Refused to apply style from 'http://localhost:8080/editar/main.50725ff9.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
5

The configuration of my route is like this:

import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/editar/:id',
        name: 'editar',
        component: () => import('../views/Edit.vue')
    },
    
]

const router = new VueRouter({
  mode: 'history',
    routes
})

export default router

As I am new to Vue I would like to ask: It is normal in Vue or I have to do some additional configuration?

  • Do you have a Vue.config.js file? It seems to me that he is searching for these resources in the wrong directory.

  • I’m using the webpack. But when I first call the page, it loads, but when I update, it gives this problem

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.