fix MkMenu

This commit is contained in:
cutestnekoaqua 2023-04-08 11:28:34 +02:00
parent 4210c35a5a
commit 11bf4d4b32
No known key found for this signature in database
GPG Key ID: 6BF0964A5069C1E0
1 changed files with 14 additions and 51 deletions

View File

@ -95,6 +95,9 @@
<MkAvatar :user="item.user" class="avatar" /><MkUserName <MkAvatar :user="item.user" class="avatar" /><MkUserName
:user="item.user" :user="item.user"
/> />
// #v-ifdef VITE_CAPACITOR
[{{ item.user.host }}]
// #v-endif
<span v-if="item.indicate" class="indicator" <span v-if="item.indicate" class="indicator"
><i class="ph-circle ph-fill"></i ><i class="ph-circle ph-fill"></i
></span> ></span>
@ -174,57 +177,17 @@
<span v-if="items2.length === 0" class="none item"> <span v-if="items2.length === 0" class="none item">
<span>{{ i18n.ts.none }}</span> <span>{{ i18n.ts.none }}</span>
</span> </span>
<span v-else-if="item.type === 'pending'" :tabindex="i" class="pending item"> </div>
<span><MkEllipsis/></span> <div v-if="childMenu" class="child">
</span> <XChild
<MkA v-else-if="item.type === 'link'" :to="item.to" :tabindex="i" class="_button item" @click.passive="close(true)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)"> ref="child"
<i v-if="item.icon" class="ph-fw ph-lg" :class="item.icon"></i> :items="childMenu"
<span v-else-if="item.icons"> :target-element="childTarget"
<i v-for="icon in item.icons" class="ph-fw ph-lg" :class="icon"></i> :root-element="itemsEl"
</span> showing
<MkAvatar v-if="item.avatar" :user="item.avatar" class="avatar"/> @actioned="childActioned"
<span :style="item.textStyle || ''">{{ item.text }}</span> />
<span v-if="item.indicate" class="indicator"><i class="ph-circle ph-fill"></i></span> </div>
</MkA>
<a v-else-if="item.type === 'a'" :href="item.href" :target="item.target" :download="item.download" :tabindex="i" class="_button item" @click="close(true)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
<i v-if="item.icon" class="ph-fw ph-lg" :class="item.icon"></i>
<span v-else-if="item.icons">
<i v-for="icon in item.icons" class="ph-fw ph-lg" :class="icon"></i>
</span>
<span :style="item.textStyle || ''">{{ item.text }}</span>
<span v-if="item.indicate" class="indicator"><i class="ph-circle ph-fill"></i></span>
</a>
<button v-else-if="item.type === 'user' && !items.hidden" :tabindex="i" class="_button item" :class="{ active: item.active }" :disabled="item.active" @click="clicked(item.action, $event)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
<MkAvatar :user="item.user" class="avatar"/><MkUserName :user="item.user"/>
// #v-ifdef VITE_CAPACITOR
[{{ item.user.host }}]
// #v-endif
<span v-if="item.indicate" class="indicator"><i class="ph-circle ph-fill"></i></span>
</button>
<span v-else-if="item.type === 'switch'" :tabindex="i" class="item" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
<FormSwitch v-model="item.ref" :disabled="item.disabled" class="form-switch" :style="item.textStyle || ''">{{ item.text }}</FormSwitch>
</span>
<button v-else-if="item.type === 'parent'" :tabindex="i" class="_button item parent" :class="{ childShowing: childShowingItem === item }" @mouseenter="showChildren(item, $event)">
<i v-if="item.icon" class="ph-fw ph-lg" :class="item.icon"></i>
<span v-else-if="item.icons">
<i v-for="icon in item.icons" class="ph-fw ph-lg" :class="icon"></i>
</span>
<span :style="item.textStyle || ''">{{ item.text }}</span>
<span class="caret"><i class="ph-caret-right ph-bold ph-lg ph-fw ph-lg"></i></span>
</button>
<button v-else-if="!item.hidden" :tabindex="i" class="_button item" :class="{ danger: item.danger, active: item.active }" :disabled="item.active" @click="clicked(item.action, $event)" @mouseenter.passive="onItemMouseEnter(item)" @mouseleave.passive="onItemMouseLeave(item)">
<i v-if="item.icon" class="ph-fw ph-lg" :class="item.icon"></i>
<span v-else-if="item.icons">
<i v-for="icon in item.icons" class="ph-fw ph-lg" :class="icon"></i>
</span>
<MkAvatar v-if="item.avatar" :user="item.avatar" class="avatar"/>
<span :style="item.textStyle || ''">{{ item.text }}</span>
<span v-if="item.indicate" class="indicator"><i class="ph-circle ph-fill"></i></span>
</button>
</template>
<span v-if="items2.length === 0" class="none item">
<span>{{ i18n.ts.none }}</span>
</span>
</div> </div>
</template> </template>