Skip to content

关于引入冲突或者说引入死循环问题 #2133

Open
@mlk255

Description

@mlk255

Question(提问)

我在实际开发中,经常遇到引入冲突问题,经常体验在

  1. axios请求方法封装的文件中引入store
  2. store中调用api方法

但我观vue-element-admin这个项目,好像也是这样写的,但并没有出现报错问题,这是为什么?

以下是我的代码片段

//api/base/index.js
import Axios from 'axios';
import Config from './config';
import { Storage } from '@util';
import { requestSuccess, requestFail, responseSuccess, responseFail } from './interceptors';
import Store from '@store'; //去掉它可以正常运行


//store/model/user.js
import { Storage } from '@util';
import API_USER from '@api/user';
import API_SYS from '@api/sys';

//一般它会抛一个Uncaught TypeError的报错,但我保证并没有这样的问题:)

Uncaught TypeError: Super expression must either be null or a function, not undefined

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions