problem description
A simple vue project made by myself, the picture shows normally during the test, visit / content/10, does not display the picture after the package is finished and run with http-server, and it is no problem to right-check the image address, but the console shows the image acquisition address to add the routing path to it! What"s going on?
static
config"./"
utils.jspublicPath
routing code
import Vue from "vue"
import Router from "vue-router"
import Index from "@/page/index"
import Content from "@/page/content"
Vue.use(Router)
export default new Router({
mode: "history",
routes: [
{
path: "/",
name: "Index",
component: Index
},
{
path: "/content/:id",
name: "Content",
component: Content
}
]
})
part of the content.vue code
<div>
<Header :title="content"></Header>
<img src="../../static/image/2.jpg" alt="">
<Footer></Footer>
</div>