title: Vuejs set a variable maximum for a number input
body: <p>I have the following vue js script:</p>
  
  <pre><code> &lt;template&gt;
      &lt;div&gt;
          &lt;div v-if='cart.length &gt; 0'&gt;
              &lt;h1&gt;Your Cart&lt;/h1&gt;
          &lt;template&gt;
              &lt;fieldset v-for='product in cart'&gt;
                  &lt;image :src='product.image'
                  &lt;h4&gt;{{product.name}}&lt;/h4&gt;
                  &lt;input type='number' :max='quantCheck'/&gt;
                  &lt;h5&gt;{{product.price}}&lt;/h5&gt;
              &lt;/fieldset&gt;
          &lt;/template&gt;
          &lt;/div&gt;
          &lt;div v-else&gt;&lt;h1&gt;Your Cart Is Empty&lt;/h1&gt;&lt;/div&gt;
          &lt;br /&gt;
          &lt;h5&gt;Subtotal: &lt;/h5&gt;
          &lt;h5&gt;Shipping: Free for a limited time!&lt;/h5&gt;
          &lt;h2&gt;Total: &lt;/h2&gt;
      &lt;/div&gt;
      &lt;/template&gt;
      &lt;script&gt;
      const apiURL = 'http://localhost:3000';
      import axios from 'axios';
      export default {
          data() {
              return {
                  cart: [
                          {
                      id:"56461",
                      name:"lilly",
                      quantity: 2,
                      price: 30.10
                      }, {
                      id:"1253",
                      name:"wild",
                      quantity: 1,
                      price: 31.10
                      }
                      ]
                  }
              },
          methods: {
                  let quantCheck = this.cart.product.quantity
  
          }
          }
      &lt;/script&gt;
  </code></pre>
  
  <p>I haven't been able to find a good way to make something like this work.  </p>
  
  <p>The quantity is variable, and I guess maybe I could make a function that checks the number after each input and pops an error when it goes above but that's not quite the goal.  </p>
  
  <p>Anyway sorry if this is a stupid question but thanks for your help in advance!</p>