How does webpack handle the problem of loading resource files introduced through `js`?

related configuration:

:/var/website/test
:
compiled
source
    components
        public
            public.vue
    static
        image
            test.png
    plugins
    // ...
static

suppose that in a source/components/public/public.vue file, a file is introduced through js :

<template>
    <section>
        <img ref="test" src="" class="image">
    </section>
</template>
<script>
export default {
    name: "" , 
    mounted () {
        this.$refs.test.src="../../static/image/test.png";
    }
};
</script>

webpack after being packaged, the resource cannot be accessed!

how does webpack handle the loading of resource files introduced through js ?

Apr.15,2021

first import then use

import src from '../../static/image/test.png';

export default {
  name: '',
  mounted() {
    this.$refs.test.src = src;
  }
};

other resources such as pictures introduced by webpack must also be require or import (which will eventually be converted to require)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e47aba-43fa9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e47aba-43fa9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?