如何支持 'onblur' 和类似事件?
How can 'onblur' and similar events be supported?
我想做类似的事情:
<td contenteditable=true @onblur(async (txt) => { ... })>
但目前似乎只支持 @onchange
,并且当 contenteditable
内容更改时实际上不会触发。我想方法是有一个调用 C# 处理程序的 JS 处理程序,但我不知道是否可以通过这种方式进行通信。现在最好的选择是拥有一个 onclick
处理程序为 'save to DB' 的按钮吗?或者有更好的选择吗?
觉得有必要在 Blazor 中构建可用事件的备忘单....似乎与离开这里有关,因为添加了 onblur。
焦点事件 (UIFocusEventArgs)
onfocus
onblur
onfocusin
onfocusout
鼠标事件 (UIMouseEventArgs)
onmouseover
onmouseout
onmousemove
onmousedown
onmouseup
onclick
ondblclick
oncontextmenu
https://github.com/aspnet/Blazor/blob/master/test/testapps/BasicTestApp/MouseEventComponent.cshtml
鼠标滚轮事件 (UIWheelEventArgs)
onwheel
onmousewheel
拖动事件 (UIDragEventArgs)
ondrag
ondragend
ondragenter
ondragleave
ondragover
ondragstart
ondrop
键盘事件 (UIKeyboardEventArgs)
onkeydown
onkeyup
onkeypress
输入事件 (UIEventArgs)
oninput
oninvalid
onreset
onselect
onselectstart
onselectionchange
onsubmit
onchange UIChangeEventArgs
剪贴板 (UIClipboardEventArgs)
oncopy
oncut
onpaste
onbeforecopy UIEventArgs
onbeforecut
onbeforepaste
触摸事件 (UITouchEventArgs)
ontouchcancel
ontouchend
ontouchmove
ontouchstart
ontouchenter
ontouchleave
https://github.com/aspnet/Blazor/blob/master/test/testapps/BasicTestApp/TouchEventComponent.cshtml
指针事件 (UIPointerEventArgs)
gotpointercapture
lostpointercapture
pointercancel
pointerdown
pointerenter
pointerleave
pointermove
pointerout
pointerover
pointerup
媒体事件 (UIEventArgs)
oncanplay
oncanplaythrough
oncuechange
ondurationchange
onemptied
onpause
onplay
onplaying
onratechange
onseeked
onseeking
onstalled
onstop
onsuspend
ontimeupdate
onvolumechange
onwaiting
进度事件 (UIProgressEventArgs)
onloadstart
ontimeout
onabort
onload
onloadend
onprogress
onerror (UIErrorEventArgs)
一般事件 (UIEventArgs)
onactivate
onbeforeactivate
onbeforedeactivate
ondeactivate
onended
onfullscreenchange
onfullscreenerror
onloadeddata
onloadedmetadata
onpointerlockchange
onpointerlockerror
onreadystatechange
onscroll
我想做类似的事情:
<td contenteditable=true @onblur(async (txt) => { ... })>
但目前似乎只支持 @onchange
,并且当 contenteditable
内容更改时实际上不会触发。我想方法是有一个调用 C# 处理程序的 JS 处理程序,但我不知道是否可以通过这种方式进行通信。现在最好的选择是拥有一个 onclick
处理程序为 'save to DB' 的按钮吗?或者有更好的选择吗?
觉得有必要在 Blazor 中构建可用事件的备忘单....似乎与离开这里有关,因为添加了 onblur。
焦点事件 (UIFocusEventArgs)
onfocus
onblur
onfocusin
onfocusout
鼠标事件 (UIMouseEventArgs)
onmouseover
onmouseout
onmousemove
onmousedown
onmouseup
onclick
ondblclick
oncontextmenu
https://github.com/aspnet/Blazor/blob/master/test/testapps/BasicTestApp/MouseEventComponent.cshtml
鼠标滚轮事件 (UIWheelEventArgs)
onwheel
onmousewheel
拖动事件 (UIDragEventArgs)
ondrag
ondragend
ondragenter
ondragleave
ondragover
ondragstart
ondrop
键盘事件 (UIKeyboardEventArgs)
onkeydown
onkeyup
onkeypress
输入事件 (UIEventArgs)
oninput
oninvalid
onreset
onselect
onselectstart
onselectionchange
onsubmit
onchange UIChangeEventArgs
剪贴板 (UIClipboardEventArgs)
oncopy
oncut
onpaste
onbeforecopy UIEventArgs
onbeforecut
onbeforepaste
触摸事件 (UITouchEventArgs)
ontouchcancel
ontouchend
ontouchmove
ontouchstart
ontouchenter
ontouchleave
https://github.com/aspnet/Blazor/blob/master/test/testapps/BasicTestApp/TouchEventComponent.cshtml
指针事件 (UIPointerEventArgs)
gotpointercapture
lostpointercapture
pointercancel
pointerdown
pointerenter
pointerleave
pointermove
pointerout
pointerover
pointerup
媒体事件 (UIEventArgs)
oncanplay
oncanplaythrough
oncuechange
ondurationchange
onemptied
onpause
onplay
onplaying
onratechange
onseeked
onseeking
onstalled
onstop
onsuspend
ontimeupdate
onvolumechange
onwaiting
进度事件 (UIProgressEventArgs)
onloadstart
ontimeout
onabort
onload
onloadend
onprogress
onerror (UIErrorEventArgs)
一般事件 (UIEventArgs)
onactivate
onbeforeactivate
onbeforedeactivate
ondeactivate
onended
onfullscreenchange
onfullscreenerror
onloadeddata
onloadedmetadata
onpointerlockchange
onpointerlockerror
onreadystatechange
onscroll