title: How to display all images from server directory in a vue javascript app
body: <p>I'm trying to display all images that exist on a host (server), in one directory (charts) into a vue page instead of having to manually list them all inside of data and therefore having to rebuild with npm every time I want to add an image. The code I have working today is below, any suggestions would be greatly appreciate.</p>
  
  <pre><code>&lt;template&gt;
    &lt;div id="app" class="media-display"&gt;
      &lt;img class="media-post" v-for="url of images" :key="url" :src="url + '?rnd=' + cacheKey" /&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import DateTime from './lib/DateTime'
  import moment from 'moment'
  
  export default {
    el: '#app',
    data() {
      return {
        images: ['/charts/chart1.png', '/charts/chart1.png'],
        cacheKey: +new Date(),
      }
    },
    created() {
      setInterval(() =&gt; {
        this.cacheKey = +new Date()
      }, 10000)
    },
    destroyed() {
      clearInterval(this.interval)
    },
  }
  &lt;/script&gt;
  </code></pre>