作为 WebSharper 的新手,我正在寻找有关运算符的文档和示例,例如 ?
, ?<-
, -<
, ===.
, =>
或|>!
。我在http://websharper.com/docs中没有找到它。我错过了吗? (http://websharper.com/docs/wig#heading-2-2 中列出了一些,但我相信这些仅用于为现有 JS 库创建接口(interface)。)here 中列出了一些。 (3 年前),这些仍然适用于 UI.Next html 吗?
最佳答案
您提到的运算符是 WebSharper 为了方便起见添加的。
例如?<-
用于改变对象的属性。
这是它的实现:
[<Inline "void ($obj[$key] = $value)">]
let ( ?<- ) (obj: obj) (key: string) (value: obj) = X<unit>
所有运算符都可以在 JavaScript.Pervasives.fs 下的 WebSharper 代码库中找到.
关于f# - WebSharper 运算符(operator),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37679152/