Answer the question
In order to leave comments, you need to log in
How to properly import images in a Parcel project?
I can't figure out how to properly import images. Here is the code itself:
<template>
<el-container>
<side-bar></side-bar>
<el-main>
<div class="top">
top
</div>
<div class="middle">
<el-image src="main-app.webp"></el-image>
</div>
</el-main>
</el-container>
</template>
<script>
import SideBar from '../components/SideBar'
import images from './pages/assets/images/*.*'
export default {
name: 'app',
data () {
return {
msg: 'Root Page Content'
}
},
components:
{
SideBar
},
}
</script>
<template>
<el-container>
<side-bar></side-bar>
<el-main>
<div class="top">
top
</div>
<div class="middle">
<el-image src="image"></el-image>
</div>
</el-main>
</el-container>
</template>
<script>
import SideBar from '../components/SideBar'
import image from './assets/images/main-app.webp'
export default {
name: 'app',
data () {
return {
msg: 'Root Page Content'
}
},
components:
{
SideBar
},
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question