我想在下面的 html 辅助方法中添加 v-on:click 或 @click:
@Html.TextBoxFor(x => x.ItnScanCaseCode, new { @id="txtid",@click = "onchangeevent();" })
怎么做?
最佳答案
您可以像这样为 htmlAttributes
使用 Dictionary
:
@Html.TextBoxFor(x => x.ItnScanCaseCode, htmlAttributes: new Dictionary<string, object> {
{ "v-on:click", "onchangeevent()" },
{ "id", "txtid" }
})
关于asp.net-mvc - 如何将带连字符和冒号的属性添加到 Razor 中的 Html Helper 方法? (vuejs 语法),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54671788/