| 123456789101112131415161718192021222324252627282930 |
- import Vue from 'vue'
- import Main from './main.vue'
- const UploadDashboardConstructor = Vue.extend(Main)
- export default {
- install (Vue) {
- Vue.prototype.$showUpload = showUpload
- Vue.prototype.$closeUpload = closeUpload
- }
- }
- let instance
- export function showUpload () {
- if (!instance) {
- instance = new UploadDashboardConstructor()
- instance.$mount()
- document.body.appendChild(instance.$el)
- }
- return instance
- }
- export function closeUpload () {
- if (instance) {
- instance.$destroy()
- document.body.removeChild(instance.$el)
- instance = null
- }
- }
|