Thank you for your response.
What you suggested is doable and I have done that before but I want to call the function defined inside of page init from a method.
Thank you for your response this helped me achieve what I had to, but I have little limitation which I am not able to clarify, please do suggest on below mentioned code.
<script>
return {
methods: {
testCode: function(value) {
console.log(value);
console.log(self.initialIndex); <--- (this shows undefined)
self.initialIndex = self.initialIndex + 1;
},
applyFilter: function () {
var self = this;
self.newVal = "hello";
this.testFn(self.newVal);
}
},
on: {
pageInit: function (e, page) {
var self = this;
var app = self.$app;
var $$ = self.$$;
self.initialIndex = 1;
self.orderBy = '';
self.testCode(self.orderBy);
}
}
}
</script>
is there any way that I can access self variables defined on page init and use them or update them in defined methods and again can use the updated value in any other defined method?
I might be asking dumb question but I am not able to figure it out. Please do suggest or any example will be helpful.