Ad

SetInlineProgress Is Not Defined Error FrameWork7-vue

I am trying to implement a progress bar based on the docs. Here I found a few examples and the function is set in the methods object.

I did declare the function, but when I try to use it says that the function is not defined. I cannot even print the console.log inside, so the function is not executed at all. I will be happy to hear some suggestions. Thanks.

<template id="page-highpth">
      <f7-page>
          <f7-navbar>
              <f7-nav-left title="Form" back-link="" sliding>
                <f7-link back-link="Back" ></f7-link>
              </f7-nav-left>
              <f7-nav-center sliding>High or rising PTH</f7-nav-center>
              <f7-nav-right>
                <f7-link icon="icon-bars" open-panel="right"></f7-link>
              </f7-nav-right>
          </f7-navbar>
          <f7-block strong>
            <p><f7-progressbar :progress="10" id="demo-inline-progressbar"></f7-progressbar></p>
            <f7-segmented raised>
              <f7-button @click="setInlineProgress(10)">10%</f7-button>
              <f7-button @click="setInlineProgress(30)">30%</f7-button>
              <f7-button @click="setInlineProgress(50)">50%</f7-button>
              <f7-button @click="setInlineProgress(100)">100%</f7-button>
            </f7-segmented>
          </f7-block>
      </f7-page>
    </template>

app.js

var app = new Vue({
  el: '#app',
  methods: {
    toHomeScreen(){
      this.$f7.getCurrentView().router.back({ pageName: 'home-page', force: true});
      this.$f7.closePanel();
    },
    setInlineProgress(value){
      const self = this;
      const app = self.$f7;
      console.log(value);
      app.progressbar.set('#demo-inline-progressbar', value);
    }
  },
  // Init Framework7 by passing parameters here
  framework7: {
    root: '#app',
    /* Uncomment to enable Material theme: */
    // material: true,
    routes: [
      {
        path:'/',
        name: 'home'
      }
      ,
      {
        path: '/education/',
        component: 'page-education'
      },
      {
        path: '/ckdmbddef/',
        component: 'page-mbddef'
      },  

    ],

  }
});
Ad

Answer

Ok, after around 6 hours I finnaly reailised that in order to access the function, I need to reference it.

var app = new Vue({...blah});

All I had to do was: app.setInlineProgress() in my code, not setInlineProgress();

Hope this will be useful to someone.

Ad
source: stackoverflow.com
Ad