title: VueJS: render new component after click
body: <p>I'd like to render new component in vue.js as if it's new page. </p>
  
  <p>I'm trying to do it with something called "dynamic component"</p>
  
  <p><strong>parent</strong>: Post.vue<br>
  <strong>child</strong>: Detail.vue  </p>
  
  <p>so, if one of the posts is clicked, Post is off and Detail is on.   </p>
  
  <p>The thing is I have to send clicked post's id to the Detail.</p>
  
  <p>Here's some of my code. </p>
  
  <p><strong>Post.vue</strong> </p>
  
  <pre><code>
  &lt;template&gt;
    &lt;div&gt;
      &lt;div v-if="loading"&gt;
        loading...
      &lt;/div&gt;
      &lt;div v-else class="container"&gt;
        &lt;ul&gt;
          &lt;li v-for="(post, index) in filteredPosts" v-bind:key="post.no"&gt;
              &lt;section class="post__main"&gt;
                &lt;div @click..?? class="main__title"&gt;{{post.title}}&lt;/div&gt;
              &lt;/section&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
      created() {
        axios.get(this.url, {
          params: {
            page: this.page,
            ord: this.ord,
            category: []
          }
        }).then(res =&gt; {
          this.posts = res.data.list;
          this.loading = false;
          this.page++;
        });
  
  </code></pre>
  
  <p><strong>Detail.vue</strong></p>
  
  <pre><code>&lt;template&gt;
      &lt;div&gt;
          {{contents}}
      &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import axios from 'axios';
  export default {
      name: 'Datail',
      data() {
          return {
              req_no: null,
              contents: {}
          }
      },
      created() {
        axios.get(url, {
          params: {
            req_no: this.req_no
          }
        }).then(res =&gt; {
            this.contents = this.res.data
        });
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I feel like I can do it with <code>props</code> and <code>v-if</code>.
  Can someone help me? Thanks!</p>