import Vue from "vue";
import UIOrientationtip from "./index.vue";

let Orientationtip = Vue.extend(UIOrientationtip);

var orientationtipInstance = "";
export function $showOrientationtip(data = {}) {
  if (orientationtipInstance) {
    return;
  }
  orientationtipInstance = new Orientationtip({
    data,
  }).$mount();

  document.body.appendChild(orientationtipInstance.$el);

  Vue.nextTick(() => {
    orientationtipInstance.show = true;
  });
}

export function $hideOrientationtip() {
  if (orientationtipInstance) {
    document.body.removeChild(orientationtipInstance.$el);
    orientationtipInstance = "";
  }
}
