2020/04/08

Vue.js Upload file using axios

<input type="file" @change="onFileChanged"> <button @click="onUpload">Upload!</button> We now need the two handler methods in our Vue component: methods: { onFileChanged (event) { const file = event.target.files[0] }, onUpload() { // upload file } Send as binary data onUpload() { axios.post('my-domain.com/file-upload', this.selectedFile) } Send as FormData onUpload() { const formData = new FormData() formData.append('myFile', this.selectedFile, this.selectedFile.name) axios.post('my-domain.com/file-upload',...

2020/04/07

mac node version nodebrew

Usage:     nodebrew help                         Show this message     nodebrew install <version>            Download and install <version> (from binary)     nodebrew compile <version>            Download and install <version> (from source)     nodebrew install-binary <version>     Alias of `install` (For backword compatibility)    ...