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