Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个使用 MobX 进行状态管理的 React 应用程序。在为一些新功能定义存储时,我想最初对存储进行硬编码,以便可以从调试过程中消除变量。我该怎么做呢?
谢谢!
我也在这样做,这对于原型制作来说是个好主意,而且mobx它绝对是微不足道的!
mobx
class State { @observable boxes = [ { id: 0, backgroundImg: 'img1.png', opened: true, }, { id: 1, backgroundImg: 'img2.png', opened: false, }, ] }