在 Blazor WASM 中,可以使用以下方法传递多个属性:
public class MyComponentProps
{
public int Prop1 { get; set; }
public string Prop2 { get; set; }
// more properties...
}
[Parameter]
public MyComponentProps Props { get; set; }
@Props.Prop1
@Props.Prop2
这样可以轻松地传递多个属性,类似于 React 中的 {...props}。