mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-25 23:50:51 +08:00
feat(settings): preview selected avatar
This commit is contained in:
@@ -73,7 +73,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onAvatarChange(e) {
|
||||
this.avatarFile = e.target.files[0]
|
||||
const file = e.target.files[0]
|
||||
this.avatarFile = file
|
||||
if (file) {
|
||||
const reader = new FileReader()
|
||||
reader.onload = () => {
|
||||
this.avatar = reader.result
|
||||
}
|
||||
reader.readAsDataURL(file)
|
||||
}
|
||||
},
|
||||
fetchPublishModes() {
|
||||
return Promise.resolve([
|
||||
|
||||
Reference in New Issue
Block a user