0

This is a copy of the HTML and JS or my fields. I have to keep this a string, so how do I parse this and add/subtract? Or is there is some way to flip to the number and then back to string? Not sure the best way about going about this without changing to a number/integer.

      <div class="col-sm-12 col-md-6 col-lg-4">
        <div class="form-group">
          <label>Total Sum Due <span class="note">2</span></label>
          <input type="text" class="form-control" v-model="document.money_due" placeholder="">
        </div>
      </div>
          <div class="row">
  <div class="col-sm-12 col-md-6 col-lg-4">
    <div class="form-group">
      <label>First Month (in USD) <span class="note"></span></label>
      <input type="text" class="form-control" v-model="document.first_month" placeholder="">
      <p-check class="p-svg p-curve m-2" color="success" v-on:change="paidFirstMonth" v-model="document.is_first_month" value="1">
        <svg slot="extra" class="svg svg-icon" viewBox="0 0 20 20"><path d="z" style="stroke: white;fill:white"></path></svg>
        <label>PAID</label>
      </p-check>
    </div>
  </div>
  <div class="col-sm-12 col-md-6 col-lg-4">
    <div class="form-group">
      <label>Last Month (in USD) <span class="note"></span></label>
      <input type="text" class="form-control" v-model="document.last_month">
      <p-check class="p-svg p-curve m-2" color="success" @change="paidLastMonth" v-model="document.is_last_month" value="1">
        <svg slot="extra" class="svg svg-icon" viewBox="0 0 20 20"><path d="" style="stroke: white;fill:white"></path></svg>
        <label>PAID</label>
      </p-check>
    </div>
  </div>
  <div class="col-sm-12 col-md-6 col-lg-4">
    <div class="form-group">
      <label>Security Deposit (in USD) <span class="note"></span></label>
      <input type="text" class="form-control" @change="hasSecurity" v-model="document.security_deposit" value="1">
      <p-check class="p-svg p-curve m-2" color="success" @change="paidSecurity" v-model="document.is_security_deposit" value="1">
        <svg slot="extra" class="svg svg-icon" viewBox="0 0 20 20"><path d="" style="stroke: white;fill:white"></path></svg>
        <label>PAID</label>
      </p-check>
    </div>
  </div>
</div>



 data() {
  return {
    now: new Date().toISOString(),
    loaded: false,
    document: {
        first_month: '',
        last_month: '',
        security_deposit: '',
    }
  }
}


  monthlyRent() {
    if(this.document.lease_month != '') {
        this.document.money_due = this.document.first_month + this.document.last_month + 
        this.document.security_deposit;
    }
  },

0 Answers0