1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- // import Vue from 'vue'
- import Charge from './charge.vue'
- import i18n from '@/util/lang/lang'
- Charge.install = function (Vue, store) {
- const ChargeConstructor = Vue.extend(Charge)
- let instance
- Vue.prototype.$showCharge = (amount = null) => {
- if (instance) {
- document.body.removeChild(instance.$el)
- instance = null
- }
- instance = new ChargeConstructor({
- el: document.createElement('div'),
- computed: {
- $store () { return store }
- },
- data () {
- return {
- showCharge: true,
- amount
- }
- },
- i18n
- })
- document.body.appendChild(instance.$el)
- }
- Vue.prototype.$showWallet = () => {
- if (instance) {
- document.body.removeChild(instance.$el)
- instance = null
- }
- instance = new ChargeConstructor({
- el: document.createElement('div'),
- computed: {
- $store () { return store }
- },
- data () {
- return {
- showWallet: true
- }
- },
- i18n
- })
- document.body.appendChild(instance.$el)
- }
- // Vue.prototype.hide = () =>{
- // if(instance) {
- // instance.showWallet = false;
- // instance.showCharge = false;
- // }
- // }
- }
- export default Charge
|