我确实有一个图像 url 让我们说http://localhost/sample.jpg。我想File在创建组件时将此图像 url 保存到对象类型中。我如何使用本机 js api 实现此目的?
export default {
created () {
const imageUrl = 'http://localhost/sample.jpg'
const file = this.getFileFromUrl(imageUrl)
},
methods: {
getFileFromUrl (url) {
// ... what should i return?
}
}
}
四季花海
相关分类