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