docs: Use <a> as example
This commit is contained in:
parent
b7459d50f9
commit
ba1fe322e9
1 changed files with 8 additions and 5 deletions
|
@ -329,11 +329,14 @@ app, you need to call `webContents.startDrag(item)` API on `ondragstart` event.
|
||||||
|
|
||||||
In web page:
|
In web page:
|
||||||
|
|
||||||
```javascript
|
```html
|
||||||
document.getElementById('targetItem').ondragstart = (event) => {
|
<a href="#" id="drag">item</a>
|
||||||
event.preventDefault()
|
<script type="text/javascript" charset="utf-8">
|
||||||
ipcRenderer.send('ondragstart', '/path/to/item')
|
document.getElementById('drag').ondragstart = (event) => {
|
||||||
}
|
event.preventDefault()
|
||||||
|
ipcRenderer.send('ondragstart', '/path/to/item')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
In the main process:
|
In the main process:
|
||||||
|
|
Loading…
Reference in a new issue