要记住在定时器开始后重设间隔属性会导致当前计数为0。
Keep in mind that resetting the Interval property after the timer has started will reset the current count back to zero.
<g:each> 标记的 status 属性是个简单的计数器字段(请注意这个值用在下一行的 ternary 语句中,用来将 CSS 样式设为 even 或 odd)。
The status attribute in the <g:each> tag is a simple counter field. (Notice this value is used on the next line in a ternary statement that sets the CSS style to either even or odd.)
如果您愿意接受一些条件的话,这是可行的。但除了不需要定义计数器属性本身之外,其他工作省不了多少。
You can do this if you are willing to accept some compromises, but other than avoiding the definition of the counter property itself, you wouldn't really save much.
应用推荐