title: Watch route object on vue js
body: <p>How to watch route object on vue js?. This is my code</p>
  
  <pre><code>watch: { 
       '$route.params.search': function(search) {
             console.log(search)
        }
  }
  </code></pre>
  
  <p>It doesn't work.</p>
  
  <p>I try use with deep still not working on <a href="https://codesandbox.io/embed/xvx81l9wrw" rel="noreferrer">here</a></p>
  
  <p>Look on code sanbox you can watch route object on main.js. </p>
  
  <blockquote>
    <p>You should not watch for the route object inside any other components. Because components get destroyed when router link changes. You should do it in the main.js file, according to your directory structure</p>
  </blockquote>
  
  <p>Thanks @santanu and @ittus</p>