1 and vue are set as follows:
offer: {
isshow:false,
sum_total_price:0,
sum_discount:0,
sum_price:0,
children:[]
}
The axios submission code under 2 and vue is as follows:
let postData={
offer:vm.offer
}
axios.post("{:url("api/plan/save")}",Qs.stringify(postData))
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
3, php is stored in mysql after receiving, and printed as follows:
"offer" => string "{"isshow":"false","sum_total_price":"0","sum_discount":"0","sum_price":"0"}" (length=75)
4, php is read from mysql and input into the template, the code is as follows:
"offer" => string "{"isshow": "false", "sum_price": "0", "sum_discount": "0", "sum_total_price": "0"}" (length=82)
problem: originally the isshow of offer should be Boolean;
now after being removed from mysql, it is changed into a string by adding double quotes;
isshow used to control the display and hiding of div elements under vue;
can not achieve this effect now;
how to solve this problem of double quotation marks?