nafeeur10
1 month ago
198
1
Vue

[Vue warn]: Error in v-on handler: "SyntaxError: Unexpected token , in JSON at position 76"

Posted 1 month ago by nafeeur10

While I am trying to add this JSON data into Database then it is giving me the above Error!

var tax_setting = '{ "total_tax_settings":  { "charge_tax": ' + this.taxInfoRadioButton + 
	', "tax_settings" : [' +
	'{ "tax_name": ' + this.taxName + 
	', "tax_rate": ' + this.taxRate +
	', "tax_included_in_price": ' + this.taxIncludeInPrice + ' } ]}}';

Radio Button of this JSON:

<v-radio-group v-model="taxInfoRadioButton">
    <v-radio color="primary" label="Do not charge tax on purchases" value="1"></v-radio>
    <v-radio color="primary" label="Charge tax on purchase" value="2"></v-radio>
</v-radio-group>

data() {
  return {
     taxInfoRadioButton: '1'
  }
}

Text Field:

<v-text-field name="taxName" label="Tax Name" id="taxName" v-model="taxName"></v-text-field>
data() {
  return {
     taxName: ''
  }
}

Tax Rate is also same as above.

Select Option in JSON:

<v-select  hide-details v-bind:items="willTaxInclude"  v-model="taxIncludeInPrice"  label="Select"  single-line  menu-props="bottom" ></v-select>
data() {
  return {
     willTaxInclude: [
        { text: "Yes", value: 1 },
	{ text: "No", value: 0 }
    ],
    taxIncludeInPrice: '0',
  }
}

Please sign in or create an account to participate in this conversation.