12345678910111213141516171819202122232425262728293031323334 |
- import Invite from './index.vue'
- import i18n from '@/util/lang/lang'
- Invite.install = function (Vue, store, router) {
- const Constructor = Vue.extend(Invite)
- let instance
- Vue.prototype.$showInvite = (type) => {
- if (instance) {
- document.body.removeChild(instance.$el)
- instance = null
- }
- store.commit('setPopInviteType', type)
- instance = new Constructor({
- el: document.createElement('div'),
- router,
- computed: {
- $store () { return store }
- },
- i18n,
- data () {
- return {
- visible: true
- }
- }
- })
- document.body.appendChild(instance.$el)
- }
- }
- export default Invite
|