mavonEditor
mavonEditor copied to clipboard
Problem with $img2Url
Hi, I read many of issues and translate them. but i can't figure out what is problem of $img2Url function! Here is my code:
async $imgAdd(pos, $file) {
const fd = new FormData()
fd.append('photo', $file)
fd.append('title', this.title)
fd.append('categoryId', JSON.stringify(this.category))
await this.$axios.post('post/photo', fd).then(response => {
this.$refs.md.$img2Url(pos, response.data.photoInfo.url)
})
},
But i got this error:
vendors.app.js:2651 error TypeError: Cannot set property '0' of undefined
at VueComponent.$changeUrl (vendors.app.js:23040)
at VueComponent.$img2Url (vendors.app.js:23040)
at index.1d58fe64d01b0adb4e15.hot-update.js:350
pos
begin with 1
, so you can try this.$refs.md.$img2Url(pos + 1, response.data.photoInfo.url)
I got same issue
I got same issue