hifarer / vueditor

A wysiwyg editor written in Vue.js and Vuex.js
http://hifarer.github.io/vueditor/
MIT License
646 stars 112 forks source link

a problem #46

Open hzyy opened 6 years ago

hzyy commented 6 years ago

Hello guys, editor.upload = function (obj, callback) { let formData = new FormData(); let xhr = new XMLHttpRequest(); formData.append('fieldName', obj.files[0]); xhr.open('POST', 'upload/url'); xhr.send(formData); xhr.onload = function () { callback(xhr.responseText); }; xhr.onerror = function (err) { console.log(err); } } how to get this obj ref?