title: What’s the best approach to compute distance between DOM Elements in Vuejs?
body: <p>I'm building a tool to generate pdf file from data, and I need to build in two formats : 105mm * 148mm and 105mm * 210mm. So I got my entire document and now it's time for me to insert page breaks. I do it with a simple class:</p>
  
  <pre><code>.page-break { display: block; page-break-before: always; }
  </code></pre>
  
  <p>Now I have to insert this class into my v-for loop. So a basic idea is to compute an interval, like each the index is a multiple of 6, I insert one. But it's not the best way to do it, I want to insert a break when the content is above 90mm.</p>
  
  <p>In order to do that, I wanted to compute the distance between 2 breaks and insert a new one if the distance is near 90mm. But, I can't find a way to access to my dynamic DOM elements...</p>
  
  <p>So the question is simple: How to compute this distance? Or if there is a better way to achieve my goal, what can I improve?</p>