import { Prop, Component } from "vue-property-decorator"; // Components import NotificationBadge from "@/components/NotificationBadge/index.vue"; import Icon from "@/components/Icon/index.vue"; import Tooltip from "@/components/Tooltip/index.vue"; import PremiumBadge from "@/components/PremiumBadge/index.vue"; import KeyNavigate from "@/utils/class_components/KeyNavigate"; import { linkType } from "@/types"; @Component({ components: { Icon, NotificationBadge, Tooltip, PremiumBadge, }, }) export default class NavSubItem extends KeyNavigate { @Prop({ type: [String, Object] }) eLink!: linkType; @Prop({ type: String }) eTitle!: string; @Prop({ type: String }) eBadge!: string; @Prop({ type: Boolean }) ePremiumBadge!: boolean; @Prop({ type: Boolean }) eActive!: boolean; @Prop({ type: Function }) readonly onEnterLink?: (lnk:linkType)=>void; isFocused = false; onFocus(): void { this.isFocused = true; } onBlur(): void { this.isFocused = false; } onEnter(e: KeyboardEvent, callerComp): void { this.isFocused = false; callerComp.kDoBlurComp(e); this.$nextTick(()=>{ if(this.eLink){ if(this.onEnterLink){ this.onEnterLink(this.eLink); } else{ this.$router.push(this.eLink); } } }) } }