npm install babel-plugin-dva-core-hmr .babelrc: { "plugins":["dva-core-hmr"] } What it does It will add HMR code forapp.modelcall. require"dva-core": "^1.4.0" Taking from thetest snapshots, it does this: importHomeModelfrom'../model/home'; ...
babel-plugin-dva-hmr HMR babel plugin for dva. Install $ npm install babel-plugin-dva-hmr redbox-react@1.x --save-dev Usage .babelrc {"plugins":["dva-hmr"]} Configure it in .roadhogrc(configure file forroadhog) only in development mode,example ...
再require一次新的model并注册到app里面 这两步也就说明了你修改了 model 中的内容, app 中缓存的 model 数据和 hmr 的根本不一致, dva 面对不一致的问题,估计就干脆 unmodel 了这个 model, 也就导致页面找不到那玩意了吧, dva 的源码没去看过,如果这个用不了,不如用 mobx 吧>_< // babel-plugin-dva...
/* eslint-disable react/destructuring-assignment */// https://umijs.org/config/constpageRoutes=require('./router.config');constwebpackplugin=require('./plugin.config');constpath=require('path');exportdefault{// add for transfer to umiplugins:[['umi-plugin-react',{antd:true,dva:{hmr:true...