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