数据绑定 带有 value属性的标记都可以使用@bind 绑定,<div>、<span>等非输入标记,无法使用@bind 指令的,默认绑定了 onchange 事件,onchange 事件是指在输入框中输入内容之后,当失去焦点时执行。 @page "/binddirective" @rendermode InteractiveAuto <h3>BindDirective</h3> <input @bind="strName" /> <p>@strName</p> @code