Skip to main content

use_palette_shortcut

Function use_palette_shortcut 

Source
pub fn use_palette_shortcut(handle: SearchPaletteHandle, enabled: bool)
Expand description

全局 ⌘K / Ctrl+K:焦点在可编辑区域时不拦截。

须在组件函数体内调用;监听挂在 window 上,组件卸载时经 on_cleanup 移除。 服务端(非 wasm32)无 DOM,什么都不做,两端调用方代码一致。