vue 这样为啥会报TypeError: Object(...) is not a function错呢?

getAppList() {
      getApps().then((res) => {
        if (!res) return;
        this.appList = res.map(({ name, id }) => {
          return {
            label: name,
            value: id,
          };
        });
        this.form.appId = this.appList[0].value;
        if (this.form.appId) {
          getAppAuthPage({ appId: this.form.appId }).then((res) => {
            if (!res) return;
            console.log('获取菜单=》', res);
            this.apiList = res.map(({ name, id }) => {
              return {
                label: name,
                value: id,
              };
            });
          });
        }
      });
    },

每次打开弹框的时候调用

show(row, type, parentId, appId) {
      this.visible = true;
      this.type = type;
      this.getAppList();
      this.$nextTick(() => {
        if (row) {
          getAppMenuDetail(row.id).then((res) => {
            this.form = Object.assign(this.form, res);
          });
        } else {
          this.$refs.form.resetFields();
          this.form.parentId = parentId;
          this.form.appId = appId;
        }
      });
    },

控制台报的

具体错误地方

阅读 1.9k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题