I initialized a project with vuecli, and then there was a problem when I introduced the image. This is what I wrote about the image obtained by js
{
src: require("../assets/slideShow/pic1.jpg"),
title: "xxx1",
href: "detail/analysis"
},
This is what I wrote about the pictures on the page
.index-board-hill .index-board-item-inner{
background: url(../assets/images/4.png) no-repeat;
}
but all of them are wrong and the path is right.
but reported this error
index.js?bed3:161 [WDS] Errors while compiling. Reload prevented.errors @ index.js?bed3:161onmessage @ socket.js?57b2:41EventTarget.dispatchEvent @ sockjs.js?3600:170(anonymous function) @ sockjs.js?3600:883SockJS._transportMessage @ sockjs.js?3600:881EventEmitter.emit @ sockjs.js?3600:86WebSocketTransport.ws.onmessage @ sockjs.js?3600:2957
index.js?bed3:167 ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6be49aa4","scoped":true,"hasInlineConfig":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/pages/index.vue
Module not found: Error: Can"t resolve "../assets/images/1.png" in "D:\vuecli\vuecli\src\pages"
@ ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6be49aa4","scoped":true,"hasInlineConfig":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/pages/index.vue 7:1417-1450
@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6be49aa4","scoped":true,"hasInlineConfig":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/pages/index.vue
@ ./src/pages/index.vue
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
what is the reason for this--