All files / src/BaseBar BaseNavBarItem.vue.js

83.33% Statements 5/6
75% Branches 3/4
100% Functions 1/1
83.33% Lines 5/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25          1x               5x     5x 3x   2x          
// @ts-check
 
import Vue from "vue";
import { startsWith } from "lodash";
 
const component = /** @type {V.Constructor<any, any>} */(Vue).extend({
  name: "BaseNavBarItem",
  props: {
    path: { type: String, default: "" },
    isDisabled: { type: Boolean, default: false }
  },
  computed: {
    active: function() {
      Iif (this.isDisabled) {
        return false;
      }
      else if (this.path === "/") {
        return this.$route.path === this.path;
      }
      return startsWith(this.$route.path, this.path);
    }
  }
});
export default component;