如何将point改为字符串类型 this$netpostBuyBuyGiftBag pointthispointgradeNumthislevelthenresp = if respdatacode === 200 alert保存成功 thisfetchTaskList else alert保存失败
将point变量转换为字符串类型的方法是使用toString()函数。在此代码中,应将point变量转换为字符串类型,如下所示:
this.$net.post('/Buy/BuyGiftBag', {point: this.point.toString(), gradeNum: this.level}).then(resp => { if (resp.data.code === 200) { alert('保存成功') this.fetchTaskList() } else { alert('保存失败') } }).catch(error => { console.log(error) alert('保存失败') })
原文地址: http://www.cveoy.top/t/topic/bb6F 著作权归作者所有。请勿转载和采集!