1、vue的offer值設(shè)定如下:offer: {
isshow:false,
sum_total_price:0,
sum_discount:0,
sum_price:0,
children:[]
}2、vue下axios提交代碼如下: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接收后存入mysql,接收時(shí)打印如下:'offer' => string '{"isshow":"false","sum_total_price":"0","sum_discount":"0","sum_price":"0"}' (length=75)4、php從mysql讀取并輸入到模板中去,代碼如下:'offer' => string '{"isshow": "false", "sum_price": "0", "sum_discount": "0", "sum_total_price": "0"}' (length=82)問題:原本offer的isshow應(yīng)該是布爾型的;現(xiàn)在從mysql取出后,加了雙引號(hào),變成字符串的;isshow原本是在vue下控制div元素的顯示與隱藏;現(xiàn)在實(shí)現(xiàn)不了這個(gè)效果了;針對(duì)這種雙引號(hào)的問題,應(yīng)該如何去解決???
添加回答
舉報(bào)
0/150
提交
取消