Using Static Assets in Custom Components
# Using Static Assets in Custom Components
Custom components support the following static file types:
- png
- jpg
- jpeg
- svg
# Usage Method:
In your code, you need to construct the image path using $publicPath$ + image filename. Example:
<template>
<div style="width: 100%;">
<div ref="wrap" style="height: 300px;">{{dImgUrl}}</div>
<img :src="dImgUrl">
</div>
</template>
<script>
export default {
data() {
return {
dImgUrl: `${$publicPath$}demo.png`
}
}
}
</script>
Note: Images cannot be used in styles.
# Uploading Images in Admin Panel:
