title: Vue.js filter table
body: <p>I'm new in vue.js, I would like to filter the following table by &quot;Director ID&quot;.</p>
  <p>When I load the page I would like to show only rows where director ID is 18. I need the table to filter right away without any user input. I would like to &quot;hardcode&quot; the ID 18 in to the function.</p>
  <p>Thank you for your help!</p>
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;div class=&quot;row&quot;&gt;
        &lt;div class=&quot;col&quot;&gt;&lt;h1 class=&quot;mt-3&quot;&gt;List of all Movies&lt;/h1&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;table class=&quot;table&quot;&gt;
        &lt;thead&gt;
          &lt;tr&gt;
            &lt;th&gt;Movie ID&lt;/th&gt;
            &lt;th&gt;Title&lt;/th&gt;
            &lt;th&gt;Release Year&lt;/th&gt;
            &lt;th&gt;Director ID&lt;/th&gt;
            &lt;th&gt;&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
          &lt;tr v-for=&quot;movie in movies&quot; :key=&quot;movie.id&quot;&gt;
            &lt;td&gt;{{ movie.id }}&lt;/td&gt;
            &lt;td&gt;{{ movie.title }}&lt;/td&gt;
            &lt;td&gt;{{ movie.releaseYear }}&lt;/td&gt;
            &lt;td&gt;{{ movie.director.id }}&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  export default {
    data: function () {
      return {
        movies: [
          {
            id: 1,
            title: &quot;They All Lie&quot;,
            releaseYear: 1989,
            director: {
              id: 18,
              firstName: &quot;Darci&quot;,
              lastName: &quot;Overill&quot;,
              nationality: &quot;China&quot;,
              birthdate: &quot;07/13/1973&quot;,
            },
          },
          {
            id: 2,
            title: &quot;Star Wars&quot;,
            releaseYear: 1997,
            director: {
              id: 18,
              firstName: &quot;Darci&quot;,
              lastName: &quot;Overill&quot;,
              nationality: &quot;China&quot;,
              birthdate: &quot;07/13/1973&quot;,
            },
          },
          {
            id: 3,
            title: &quot;Mamma mia&quot;,
            releaseYear: 2005,
            director: {
              id: 19,
              firstName: &quot;John&quot;,
              lastName: &quot;Smith&quot;,
              nationality: &quot;USA&quot;,
              birthdate: &quot;07/13/1980&quot;,
            },
          },
        ],
      };
    },
  };
  &lt;/script&gt;
  </code></pre>