My css is placed inside the static directory.
html:
<html>
<head>
<link rel="stylesheet" href="static/font-awesome/css/font-awesome.min.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
And I have nested routes
const routes = [
{
path: '/user/:id', component: Profile,
children: [
{
path: 'feeds',
component: ProfileFeeds
},
{
path: 'photos',
component: ProfilePhotos
},
]
},
... some other routes... ,
];
When I am outside of the nested route, the static file is found. But, when I navigate to user/user_21/feeds
, Vue can't find the css.
The working css:
http://localhost:8080/static/font-awesome/css/font-awesome.min.css
Turns into a wrong static path:
http://localhost:8080/user/static/font-awesome/css/font-awesome.min.css
How can I solve this?
What if you link an absolute url for the css begining with a /
?
<link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With