title: Vue.js 2 can get body scroll position but not set body scroll position
body: <p>I have a Vue.js app where I am opening a modal and need to set the body under it to a fixed position to prevent it scrolling on mobile. This of course scrolls it to the top. Before opening the modal, I get the scroll position and set it like so:</p>
  
  <pre><code>this.bposition = document.body.scrollTop
  console.log(document.body.scrollTop)
  </code></pre>
  
  <p>And this works fine, I can output the correct position in my console. But then, when I close my modal, I try to do this:</p>
  
  <pre><code>  console.log(this.bposition) // proves my close function is running and gets the correct value
    var el = document.querySelector('body')
    el.scrollLeft = 0 // have tried with and without this line
    el.scrollTop = this.bposition
  </code></pre>
  
  <p>But to no avail, the page will not scroll. I have tried on various elements within the page as well, none of them scroll.</p>