Skip to content

E0144: A tag leaves out a parameter ​

A template or function used as a tag takes its parameters as attributes, by name: item={…} sets the parameter item, and a bare attribute sets a bool parameter to true. A first ctx context.Context is passed for it, the content between the tags fills a children ui.Node parameter, a <slot:x> an x ui.Node one, and these may be left out. Every other parameter is set, as a call passes every argument.

Wrong ​

html
package layouts

func Menu(i Item)
<nav><navLink item={i}/></nav>

func navLink(item Item, on bool)
<a href={item.Href} class:on={on}>{item.Label}</a>
html
package layouts

func Menu(i Item)
<nav><navLink item={i} on={false}/></nav>

func navLink(item Item, on bool)
<a href={item.Href} class:on={on}>{item.Label}</a>

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.