I need to define the path to an asset from the script section of my component, where I can't use "@/" or "../" because these just show up without being replaced in the DOM.
What is the best way of defining an asset path in the script?
<template>
<video
loop
autoplay
muted
>
<source :src="source" type="video/mp4">
</video>
</template>
<script>
export default {
props: {
sourceFile: {
type: String
},
},
computed: {
source () {
return this.sourceFile || '@/assets/video/video.mp4'
}
},