useIpcRendererInvoke
useIpcRendererInvoke
リアクティブな ipcRenderer.invoke API の結果。非同期操作を同期的に見せます。
使用法
import { useIpcRendererInvoke } from '@vueuse/electron'
import { computed } from 'vue'
// ipcRenderer を明示的に提供しない場合は nodeIntegration を有効にしてください
// 参照: https://www.electronjs.org/docs/api/webview-tag#nodeintegration
// Ref 結果が返されます
const result = useIpcRendererInvoke<string>('custom-channel', 'some data')
const msg = computed(() => result.value?.msg)
© 2019–PRESENT Anthony Fu https://github.com/antfu
※このページは Nuxt.js 公式ドキュメントの翻訳ページです。
公式ドキュメントの該当ページはこちら:
#