1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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 }
- },
- i18n,
- data () {
- return {
- visible: true,
- imageUrl,
- isMe: true
- }
- }
- })
- 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
- }
- }
- })
- document.body.appendChild(instance.$el)
- }
- }
- export default Avatar
|