Closed sweetyuria closed 4 years ago
hooks: {
addImageBlobHook (blob, callback) {
let fileUpload = (blob) => {
const formData = new FormData()
formData.append('file', blob)
const axios = require('axios') // this way
axios.post('/api/external/fileUpload', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
}).then(res => {
if (res.data.code !== 0) throw res.data.message
callback.call('[image]', res.data.data.imageUrl)
}, () => alert('μμ€ν
μμ μ€λ₯κ° λ°μνμμ΅λλ€. κ°λ°νμ λ¬Έμλ°λλλ€.'))
.catch(errorMsg => alert(errorMsg))
}
fileUpload(blob, callback)
return true
}
}
Version
@toast-ui/vue-editor: 1.1.1 vue: 2.6.10
Test Environment
Chrome IOS
Current Behavior
Expected Behavior
addImageBlobHook call vue method.
I'd like to call my Vue method. How could I access the Vue method?
vue μ΄λ³΄λΌμ μ΄λ»κ² μ κ·Όν μ§ λͺ¨λ₯΄κ² μ΅λλ€. μ’μ μλν°λ₯Ό λ§λ€μ΄ μ£Όμ΄μ κ°μ¬ν©λλ€. λ©μ§κ³ νκΈ νΈν μλλ€λ μλν°λ₯Ό μ°κ³ μΆμ΅λλ€. μ΄λ―Έμ§ μ λ‘λμ ν λ μ 곡ν΄μ λ± νμν©λλ€. λ§€μ° μ°κ³ μΆμ΅λλ€. λμμ£ΌμΈμ.