mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-30 00:06:43 -06:00
17 lines
357 B
TypeScript
17 lines
357 B
TypeScript
|
import Ctx from '../views/components/context-menu.vue';
|
||
|
|
||
|
export default function(e, menu, opts?) {
|
||
|
const o = opts || {};
|
||
|
const vm = new Ctx({
|
||
|
propsData: {
|
||
|
menu,
|
||
|
x: e.pageX - window.pageXOffset,
|
||
|
y: e.pageY - window.pageYOffset,
|
||
|
}
|
||
|
}).$mount();
|
||
|
vm.$once('closed', () => {
|
||
|
if (o.closed) o.closed();
|
||
|
});
|
||
|
document.body.appendChild(vm.$el);
|
||
|
}
|