您将 .catch() 附加到 setState() 而不是 .then()改变:axios .delete(apiVideoUrl, {}) .then((response: any) => { this.setState({ adminhelpcard: adminhelpcard.filter((adminhelpcard: SingleAdminHelpCard) => adminhelpcard.id !== id) }).catch(function(error) { console.log(error); });到:axios .delete(apiVideoUrl, {}) .then((response:any) => { this.setState({ adminhelpcard: adminhelpcard.filter((adminhelpcard: SingleAdminHelpCard) => adminhelpcard.id !== id) }) }).catch(function(error) { console.log(error); });
1 回答
![?](http://img1.sycdn.imooc.com/545847f50001126402200220-100-100.jpg)
慕雪6442864
TA贡献1812条经验 获得超5个赞
尝试使用 minDate
$('#datepicker').datepicker({
minDate: '0d',
beforeShowDay: function(date) {
// 0 - Sunday, 1 - Monday
return [date.getDay() == 0 || date.getDay() == 1 ? false : true];
}
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<input id="datepicker"/>
添加回答
举报
0/150
提交
取消