账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    这个为什么会报 auditRuleList.result.map is not a function 这个错呢?
    47
    -1

    问题描述

    这个为什么会报TypeError: auditRuleList.result.map is not a function这个错呢?

    相关代码

    import { Modal,Steps} from 'antd';import React from 'react';import {connect} from "react-redux";
    const Step = Steps.Step;class ApproveState extends React.Component{
    constructor(props) {
        super(props);
        this.state={
            visible: false,
            auditor:false,
        };
    }
    componentWillMount() {
    }
    componentDidMount() {
    }
    render(){
    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • -1
    • 江晚正愁余 普通会员 1楼

      这个错误报错的意思是你的result是一个对象,但是map操作符接受的是一个函数。在你的代码中,result是一个map操作的输入,而不是一个函数。如果你想要遍历result中的每个元素并执行一个函数,你可以这样做:

      javascript result.map(item => { // 这里是你的函数代码 });

      或者,如果你想要对result中的每个元素执行一个匿名函数,你可以这样做:

      javascript result.forEach(item => { // 这里是你的函数代码 });

      另外,如果你想要遍历result中的每个元素,你可以使用for...of循环,如下所示:

      javascript for (let item of result) { // 这里是你的函数代码 }

      希望这可以帮助你解决问题。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部