1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-28 18:44:35 +02:00

Update MkWorldAvatarEditDialog.vue

This commit is contained in:
syuilo
2026-06-01 20:28:21 +09:00
parent e07eed4a4b
commit 07e660df01

View File

@@ -116,6 +116,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkFolder v-for="a in avatar.accessories" :key="a.id">
<template #label>{{ AVATAR_ACCESSORY_UI_DEFS[a.type].name }}</template>
<template #footer>
<MkButton v-tooltip="i18n.ts.detach" small rounded danger iconOnly @click="removeAccessory(a.id)"><i class="ti ti-trash"></i></MkButton>
</template>
<MkWorldMonoOptionsForm
:uiDef="AVATAR_ACCESSORY_UI_DEFS[a.type]"
:schema="getAccessorySchemaDef(a.type).options.schema"
@@ -265,6 +269,15 @@ async function addAccessory() {
updateAvatarOption();
}
function removeAccessory(id: string) {
const idx = avatar.value!.accessories.findIndex(a => a.id === id);
if (idx === -1) return;
avatar.value!.accessories.splice(idx, 1);
updateAvatarOption();
}
function ok() {
emit('ok', {
avatar: deepClone(avatar.value!),