title: Detect browser close or page change VueJs
body: <p>I try to detect when user change/insert into an input and he try to change/close page to give him a warning. I do some research but till now I didn't find anything.</p>
  
  <pre><code>&lt;b-form-group label="Name" label-for="name-input"&gt;
  &lt;b-form-input
          id="name-input"
          v-model="name"
  &gt;&lt;/b-form-input&gt;
  &lt;/b-form-group&gt;
  
  created() {
      document.addEventListener('beforeunload', this.handlerClose)
  },
  handlerClose: function handler(event) {
      console.log('CHANGE!!!!');
  },
  </code></pre>