-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,535 additions
and
583 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import ContextmenuModal from './index.vue' | ||
import Vue from 'vue' | ||
|
||
export default function({ x = 0, y = 0, list = [] }) { | ||
const mountNode = document.createElement('div') | ||
const randomString = Math.random() | ||
.toString(36) | ||
.substring(2) | ||
mountNode.id = randomString | ||
document.body.appendChild(mountNode) | ||
const mountNode2 = document.createElement('div') | ||
mountNode.appendChild(mountNode2) | ||
const el = new Vue({ | ||
render: h => | ||
h(ContextmenuModal, { | ||
props: { | ||
x, | ||
y, | ||
list, | ||
onCancel: () => { | ||
el.$destroy() | ||
var element = document.getElementById(randomString) // Get the element by its ID | ||
if (element) { | ||
element.parentNode.removeChild(element) // Remove the element from its parent node | ||
} | ||
} | ||
} | ||
}) | ||
}) | ||
el.$mount(mountNode2) | ||
} |
Oops, something went wrong.