title: How make dynamic breadcrumbs in vue.js?
body: <p>I would like to have a dynamic breadcrumbs based on where I clicked on a category but I get an error that says my variable is undefined: <code>TypeError: Cannot read properties of undefined (reading 'homeMenu')</code>. Yet in my <code>getHomeCategory</code> function, the console.log of <code>homeCategory</code> displays <code>Perma'Thèque</code>. I don't understand how to do it, thanks</p>
  <p>Here is the code :</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
      export default {
          props: {
          },
          data: () =&gt; ({
              homeMenu: &quot;&quot;,
              breadcrumbs: [
                  {
                      text: 'Accueil',
                      disabled: false,
                      href: '/',
                  },
                  {
                      text: this.homeMenu,
                      disabled: false,
                      href: &quot;/&quot; + this.homeMenu,
                  },
              ],
              
          }),
          computed: {
              ...mapGetters({
                  console: () =&gt; console,
                  homeCategory: 'home/getCategory',    
              })
          },
          methods: {
              getHomeCategory ()  {
                  if (this.homeCategory === &quot;Perma'Thèque&quot;) {
                      console.log(this.homeCategory)
                      return this.homeMenu = &quot;permatheque&quot;
                  } else {
                      return this.homeMenu = &quot;null&quot;
                  }
              },
  
              
          },
          mounted() {
              if (this.plantActive) this.loading = false;
              this.getHomeCategory()
          }
      }
  &lt;/script&gt;
  </code></pre>