Hi,
i wonder how i would call Api-Methods from inside a custom class or object literal, because this is then referring to the Class Instance / Object.
I searched the window object, but couldn’t find anything.
My use case is the following:
Object Literal or Class:
var Test = {
test: function () {
// access the Framework7 API eg. request.json(...
// Neither app.request nor Framework7.request works,
// and the scope of this is the class or object here
}
}
export default Test;
in main.js:
import test from './common/test.js';
Vue.prototype.$test = test;
const app = new Vue({
...
And then in a component:
...
methods: {
onTest() {
this.$test.test();
}
}
...
As said before, inside the Class or Object, this refers to the Class or Object Instance and in the window object i couldn’t find any hint to the api.
I’m still using Framework7 v2.
Thanks in advance.