本文介绍了流类型,`+`符号在属性前面是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了以下用js FlowType编写的代码(我有兴趣知道在FlowType的上下文中+的值不是普通的JS)。

I came across the following code written in js FlowType (I am interested to know the value of + in the context of FlowType not in general JS).

可能您可以解释一下 + 符号在下面的代码中在该属性前面的含义:

Could you please explain me what does the + symbol mean in front of the property in the code below:

  export type User = {
      +name: string,
      +surname: string,
      +personId: PourceId,
    }

我在文档中找不到任何参考,也欢迎任何链接。

I could not find any reference in the documentation, any link is also welcome.

推荐答案

物业前面的 + 符号表示该物业是只读

The + symbol in front of the property means the property is read-only

参考:

这篇关于流类型,`+`符号在属性前面是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 02:49
查看更多