Coder Social home page Coder Social logo

Comments (14)

xianaldo avatar xianaldo commented on May 7, 2024

遇到一样的问题

from antd-admin.

zuiidea avatar zuiidea commented on May 7, 2024

依次檢查:

  • src/index.js有沒有已經定義了該model(即app.model()
  • src/models文件夾下的文件的namespace是否重複定義

from antd-admin.

YehanZhou avatar YehanZhou commented on May 7, 2024

检查了这两项,都没有问题。
会不会是路由跳转的时候,由于又require了一次model,导致namespace又定义一遍,所以重复了?

from antd-admin.

zuiidea avatar zuiidea commented on May 7, 2024

不會啊,第一次跳轉到該路由時,僅加載一次該組件的js,此時是第一次require該組件的model,整個項目衹會require一次model/markets
試試注釋該路由,會不會報錯
方便的話,提交到你的分支,我幫你檢查一下

from antd-admin.

YehanZhou avatar YehanZhou commented on May 7, 2024

我刚下载了这个分支上的代码,不加任何改动就会报错。
你试一下,先跳到【仪表盘】,再跳到【用户管理】,再又跳回到【仪表盘】,就会报错。
应该就是第二次跳某个带model的路由时,就会报app.model: namespace should be unique。

from antd-admin.

zuiidea avatar zuiidea commented on May 7, 2024

這兩天出去玩了,沒帶電腦😅

gif

我這邊暫時不能復現

from antd-admin.

taven-liu avatar taven-liu commented on May 7, 2024

出现同样问题了

from antd-admin.

zuiidea avatar zuiidea commented on May 7, 2024

@taven-liu能看一下你的新增代码吗

from antd-admin.

taven-liu avatar taven-liu commented on May 7, 2024

{ path: 't1', name: 't1', getComponent (nextState, cb) { require.ensure([], require => { app.model(require('./modules/aTest/models/t1')) cb(null, {component: require('./modules/aTest/containers/t1Container')}) }) } },

from antd-admin.

xianaldo avatar xianaldo commented on May 7, 2024

from antd-admin.

zuiidea avatar zuiidea commented on May 7, 2024

dvajs/dva#465

可能是dva版本的原因,暂时先把dva 切换到 1.1 版本吧,后面我解决一下

from antd-admin.

zuiidea avatar zuiidea commented on May 7, 2024

已解决 ff2005d

from antd-admin.

xiaosansiji avatar xiaosansiji commented on May 7, 2024

@zuiidea @YehanZhou @xianaldo

dvajs/dva#533 官方针对1.2的解决办法,最好还是搞下吧,要不升级到1.2后还会有问题

from antd-admin.

zuiidea avatar zuiidea commented on May 7, 2024

@xiaosansiji ,现在升级没问题了啊,ff2005d

from antd-admin.

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.