Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有:
#set( $maxVersion = 500 )
我想填充这样的列表:
$myList = ("someString_10" "someString_20" "someString_30" ... "someString_500")
是否有机会仅使用速度模板动态填充它?
我在官方文档中看到,支持列表和 #foreach循环。然而它在这里没有帮助,我需要一种 for/while 指定条件来结束循环。
#foreach
#set ($maxVersions = 500) #set ($step = 10) #set ($start = 1) #set ($count = $maxVersions / $step) #set ($myList = []) #foreach ($i in [$start..$count]) #set ($item = $i * $step) #set ($discard = $myList.add("someString_${item}")) #end $myList