I do have an image url lets say http://localhost/sample.jpg
. i want to save this image url into a File
object type as my component created. how can i achieve this with native js api?
export default {
created () {
const imageUrl = 'http://localhost/sample.jpg'
const file = this.getFileFromUrl(imageUrl)
},
methods: {
getFileFromUrl (url) {
// ... what should i return?
}
}
}