import Vue from 'vue'
import ShowPicture from './showpicture'

import elementUtil from '../../common/scripts/elementUtil'

class VueShowPicture {
  constructor () {
    this._vm = undefined
  }
  show (option) {
    elementUtil.createElement('vum-show-picture')

    this._vm = new Vue(ShowPicture)
    this._vm.$mount('[vum-show-picture]')

    setTimeout(() => {
      this._vm.show(option)
    })
  }

  hide () {
    this._vm.hide()
  }

  getState () {
    return this._vm ? this._vm.getState() : 0
  }
}

export default new VueShowPicture()
