🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
| 操作符用来在模式中描述多个接受的模式: > The | operator can be used anywhere within patterns to describe multiple accepted patterns: ~~~ var match = switch(7) { case 4 | 1: "0"; case 6 | 7: "1"; case _: "2"; } trace(match); // 1 ~~~ 在一个 or 模式中,如果有一个捕获的变量,它必须也出现在它的子模式中。 > If there is a captured variable in an or-pattern, it must appear in both its sub-patterns.