| Attribute Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | No | default | The name of the counter |
| start | number | No | 1 | The initial number to start counting from |
| skip | number | No | 1 | The interval to count by |
| direction | string | No | up | the direction to count (up/down) |
| boolean | No | true | Whether or not to print the value | |
| assign | string | No | n/a | the template variable the output will be assigned to |
counter is used to print out a count. counter will remember the count on each iteration. You can adjust the number, the interval and the direction of the count, as well as determine whether or not to print the value. You can run multiple counters concurrently by supplying a unique name for each one. If you do not supply a name, the name 'default' will be used.
counter 的功能是用來輸出 count。counter 會紀錄每次 iteration 的 count。你可 以調整 count 的 number, interval 與 direction,也可以設定是否要列印值。你可以為每個 counter 取不同的名字,以便在同一時間內使用多個 counter,如果你沒有給定名字的話,則系 統會使用預設名字 'default'。
If you supply the special "assign" attribute, the output of the counter function will be assigned to this template variable instead of being output to the template.
如果你有使用 "assign" 屬性,則 counter 函式的輸出會被指定給某個樣版變數而不 會直接輸出至樣版。