Skip to content

Commit 43b5c40

Browse files
authored
Avatar upload input
1 parent 2e01e12 commit 43b5c40

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

input/AvatarInput.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script setup>
22
import axios from 'axios'
33
import Input from '@/components/input/Input.vue'
4+
import avatar from './profil/avatar.png'
45
import { toRefs } from 'vue'
56
67
const props = defineProps({
7-
image: { default: 'https://i.pravatar.cc/128' },
8+
image: { default: avatar },
89
label: { default: 'Select image' },
910
remove_avatar_url: { default: 'web/api/remove/avatar' },
1011
remove_success: { default: 'Avatar removed.' },
@@ -23,6 +24,7 @@ function getImagePath(e) {
2324
async function removeAvatar() {
2425
try {
2526
await axios.get(props.remove_avatar_url)
27+
image.value = avatar
2628
alert(props.remove_success)
2729
} catch (err) {
2830
alert(props.remove_error)
@@ -92,3 +94,5 @@ async function removeAvatar() {
9294
border: 2px solid var(--wow-accent);
9395
}
9496
</style>
97+
98+
<!-- Avatars https://i.pravatar.cc/128 -->

0 commit comments

Comments
 (0)