MobX 中文网

MobX 中文网

  • API 文档
  • Nodejs.cn 旗下网站

›介绍

介绍

  • 关于 MobX
  • 关于本文档
  • 安装
  • MobX 的要点

MobX 核心

  • 可观察状态
  • 操作
  • 计算
  • 反应 {🚀}
  • API

MobX 与 React

  • React 集成
  • React 优化 {🚀}

提示与技巧

  • 定义数据存储
  • 了解反应性
  • 子类化
  • 分析反应性 {🚀}
  • 使用参数进行计算 {🚀}
  • MobX-utils {🚀}
  • 自定义可观察值 {🚀}
  • 惰性可观察量 {🚀}
  • 集合实用程序 {🚀}
  • 拦截和观察 {🚀}

微调

  • 配置 {🚀}
  • 装饰器 {🚀}
  • 从 MobX 4/5 迁移 {🚀}

关于本文档

¥About this documentation

它遵循以下原则:在专业信息之前介绍最常用的概念。这适用于概念表中的标题以及这些标题下的页面。

¥It follows the principle that the most commonly used concepts are introduced before specialized information. This applies to the headings in the table of concepts as well as the pages under those headings.

我们用 {🚀} 标记标记了更高级的部分和概念。你可能不需要理解它们,直到你有一个特殊的用例,并且可以在不了解它们的情况下非常有效地使用 MobX。请随意跳过它们并继续下一部分!

¥We've marked the sections and concepts that are more advanced with the {🚀} marker. You likely won't have to understand them until you will have a special use case, and can use MobX very effectively without knowing about them. Feel free to skip them and move on to the next section!

该文档已针对 MobX 6 进行了重写。对于旧版本的 MobX,可以找到 此处。所有原理都是相同的,API 也基本相同。主要区别在于,在 MobX 6 之前,decorators 是编写 MobX 增强类的推荐语法。

¥The documentation has been rewritten for MobX 6. For older versions of MobX, it can be found here. All the principles are the same, and the API is largely the same. The main difference is that before MobX 6, decorators were the recommended syntax to write MobX enhanced classes.

文档摘要可以作为备忘单下载:

¥A summary of the documentation can be downloaded as cheat sheet:

导览

¥Guided tour

要全面了解如何将 MobX 与 React 结合使用,请通读当前的简介标题,特别是 MobX 的要点 部分。它将向你介绍最重要的原则、API 以及它们之间的关系。阅读本文后,你应该已经准备好使用 MobX!

¥To get an overall idea of how to use MobX with React, read through the current Introduction heading, in particular The gist of MobX section. It will introduce you to the most important principles, APIs and how they relate. You should be ready to use MobX once you read this!

以下是关于接下来要检查的事项的一些建议:

¥Here are a few suggestions about the next things to check out:

  • 试试 10 分钟 MobX 和 React 互动介绍

    ¥Try the 10 minute interactive introduction to MobX and React

  • React 集成

    ¥React integration

  • makeObservable/makeAutoObservable

  • 了解 actions,其中包括对异步操作的讨论

    ¥Learn about actions, which includes a discussion on asynchronous actions

  • computeds 的基础知识

    ¥The basics of computeds

  • 阅读有关 autorun 的内容,只是因为它在示例中使用

    ¥Read about autorun, if only because it's used in the examples

  • 要了解如何组织应用的数据存储,请查看 定义数据存储

    ¥To get an idea on how to organize your application's data stores, check out Defining data stores

  • 如果 MobX 的行为让你感到困惑,那么查看 了解反应性 会很有用

    ¥If the behavior of MobX confuses you, it's useful to check out Understanding reactivity

  • 获取 API 快速概览,也在顶部导航栏中链接

    ¥Get a quick overview of the API, also linked in the top navigation bar

这应该能让你很好地理解 MobX 的日常使用。还有更多内容可供你在闲暇时阅读。

¥This should give you a good understanding of the day-to-day uses of MobX. There is plenty more available for you to read at your own leisure.

← 关于 MobX安装 →
  • 导览
MobX v6.13 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站