[improvement] Overlay: functional & tsx (#2822)

This commit is contained in:
neverland
2019-02-22 09:27:00 +08:00
committed by GitHub
parent ea36edbd1a
commit 91a9345a7d
4 changed files with 68 additions and 42 deletions
+5 -4
View File
@@ -1,6 +1,6 @@
import Vue from 'vue';
import context from './context';
import Overlay from '../../overlay';
import { mount } from '../../utils/functional';
const defaultConfig = {
className: '',
@@ -35,10 +35,11 @@ export default {
let { modal } = context;
if (!modal) {
modal = new (Vue.extend(Overlay))({
el: document.createElement('div')
modal = mount(Overlay, {
on: {
click: this.onClick
}
});
modal.$on('click', this.onClick);
context.modal = modal;
}