HbuilderX 小随笔

在使用uni.showModal过程中,在确认回答后,进行接口操作this.$api.xx时提示this.$api不存在,应该在进行showModal前设置

_this=this

uni.showModal({
                    title: '请注意',
                    content: '确认要删除该成绩吗?',
                    success: function (re) {
                        if (re.confirm)
                        {                     
                            _this.$api.xxxx({
                              参数:参数值
                            }).then(res => {
                            
                                }else{
                                
                                }
                            })
                        }
                    }
                });           

posted @ 2024-09-14 15:19  bwteacher  阅读(7)  评论(0编辑  收藏  举报