index.js 548B

12345678910111213141516171819202122232425262728
  1. import Vue from 'vue'
  2. import Popup from './index.vue'
  3. const PopupBox = Vue.extend(Popup)
  4. Popup.install = function (data,methods) {
  5. let instance = new PopupBox({
  6. data,
  7. methods
  8. }).$mount()
  9. document.body.appendChild(instance.$el)
  10. instance.toClick_1()
  11. Vue.nextTick(() => {
  12. instance.show = true
  13. // this.$router.push({path:"/good/order/edit?id=" + instance.id});
  14. // show 和弹窗组件里的show对应,用于控制显隐
  15. setTimeout(() => {
  16. instance.show = false
  17. }, 3000);
  18. })
  19. }
  20. export default Popup