美文网首页
SCXML 可执行内容 if、 else、 else if

SCXML 可执行内容 if、 else、 else if

作者: 寻找无名的特质 | 来源:发表于2021-01-29 06:01 被阅读0次

<if> 是条件执行元素的容器,属性是条件cond,子元素可以是<else>和<else if>。这些元素很好理解,与一般的控制语句一样,elseif可以有多个,else需要在所有的elseif后出现,最后是</if>结束符。这些元素可以嵌套,下面是一个简单的例子:

<if cond="cond1">
  <!-- selected when "cond1" is true -->
<elseif cond="cond2"/>
  <!-- selected when "cond1" is false and "cond2" is true -->
<elseif cond="cond3"/>
  <!-- selected when "cond1" and "cond2" are false and "cond3" is true -->
<else/>
  <!-- selected when "cond1", "cond2", and "cond3" are false -->
</if>

很直观也很简单。

相关文章

网友评论

      本文标题:SCXML 可执行内容 if、 else、 else if

      本文链接:https://www.haomeiwen.com/subject/rqzkzktx.html