Preview:
 <extend-text-input
                          v-model="invItem.useQuantity"
                          @keyup="handleKeyUp($event, invItem.quantity,bomIndex,index)"
                        />
以及method
 handleKeyUp(event, maxNumber , bomIndex,invIndex) {
    const inputValue = event.target.value;
    const newValue = inputValue.replace(/^0+|[^0-9]/g, '').replace(/(\d+)/, ($1) => (parseInt($1) > maxNumber ? maxNumber : $1)).substring(0, String(maxNumber).length);
    
    this.data[bomIndex].inventoryItems[invIndex].useQuantity = newValue;
  }
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter