title: In vue-router, how to use beforeLeave
body: <p>I want to finish some information verify before one component leave.</p>
  
  <p>I've scanned the <code>vue-router</code> document: <a href="https://router.vuejs.org" rel="nofollow noreferrer">https://router.vuejs.org</a></p>
  
  <p>But I use <code>vue-cli</code>, in my file: router1.vue,</p>
  
  <pre><code>console.log(this.$router.beforeLeave) -&gt; undefined
  </code></pre>
  
  <p>How can I use it?</p>