我在 Play 2.4.6 中有以下模板定义块(使用 scala 2.11.6 和 sbt 0.13.8)我在以下代码中得到“缺少参数类型”:
@property(budgetId: Int, propertyName: String, value: String, shouldEdit: Boolean = false, displayMethod: Option[String => String] = None) = {
<div>
<label class="prop-name">@displayMethod.getOrElse(String => propertyName)(propertyName)</label>
@shouldEdit ? editable(budgetId, routes.Budgets.update(budgetId), "input", propertyName, value) : <span>@value</span>
</div>
}
@editable(id: Int, url: Call, inputType: String, name: String, value:String) = {
<div class="editable"
data-editable-input="@inputType" data-editable-url="@url"
data-editable-id="@id" data-editable-property="@name" >@value</div>
}
任何人都知道为什么会这样?