GithubHelp home page GithubHelp logo

request.js 文件依赖import store from '@/store',会导致编译循环依赖RangeError: Maximum call stack size exceeded about ant-design-vue-pro HOT 9 CLOSED

vuecomponent avatar vuecomponent commented on May 22, 2024
request.js 文件依赖import store from '@/store',会导致编译循环依赖RangeError: Maximum call stack size exceeded

from ant-design-vue-pro.

Comments (9)

sendya avatar sendya commented on May 22, 2024

06303db

vuejs/vue-cli#2463

from ant-design-vue-pro.

BarronLin avatar BarronLin commented on May 22, 2024

作者大大,那现在vue cli官方都没人去修,我们现在怎么办?

from ant-design-vue-pro.

sendya avatar sendya commented on May 22, 2024

经测试没有你描述的问题发生,你可以看一下提交内容。确实有引用到这两个方法,并且这个两个方法的引用在 TableList.vue 也用到了。

7282264#diff-ff155d4a440197a6f84e8714fd6374e9R153

from ant-design-vue-pro.

BarronLin avatar BarronLin commented on May 22, 2024

经测试没有你描述的问题发生,你可以看一下提交内容。确实有引用到这两个方法,并且这个两个方法的引用在 TableList.vue 也用到了。

7282264#diff-ff155d4a440197a6f84e8714fd6374e9R153

import { getRoleList, getServiceList } from '@/api/manage' 你可以放到其他page文件,比如workplace.vue 就会编译出上面错误的,作者大大有联系方式可以交流下吗?

from ant-design-vue-pro.

sendya avatar sendya commented on May 22, 2024

你也可以尝试在 request.js 里去掉 import store from '@/store' 以及 21 行的

store.dispatch('Logout').then(() => {
        location.reload()
      })

from ant-design-vue-pro.

sendya avatar sendya commented on May 22, 2024

这是测试代码

https://github.com/sendya/ant-design-pro-vue/blob/master/src/views/dashboard/Workplace.vue#L120

20181108165652

from ant-design-vue-pro.

BarronLin avatar BarronLin commented on May 22, 2024

这是测试代码

https://github.com/sendya/ant-design-pro-vue/blob/master/src/views/dashboard/Workplace.vue#L120

20181108165652

这是注释掉“你也可以尝试在 request.js 里去掉 import store from '@/store' 以及 21 行的”之后尝试的吗

from ant-design-vue-pro.

sendya avatar sendya commented on May 22, 2024

没注释哦,你可以拉完整代码在你本地跑试试

from ant-design-vue-pro.

OJesusO avatar OJesusO commented on May 22, 2024

const _import = file => () => import(`@/views/${file}`).then(m => m.default)

换成

const _import = file => require(`@/views/${file}`).default

可以跑成功 0.0

@BarronLin 不知道对你有无用

from ant-design-vue-pro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.