framework7
framework7 copied to clipboard
FrameworkVue,access $f7 in route element monted lifecycle
This is a (multiple allowed):
-
[x] bug
-
[ ] enhancement
-
[ ] feature-discussion (RFC)
-
Framework7 Version: framework-vue 0.9.1.
-
Platform and Target: browser.
What you did
mounted(){
var homeElement = this.$refs.homeContainer.$el
this.$f7.pullToRefreshTrigger(homeElement)
},
trying to use $f7 in the route element mounted lifecycle,and then throw err : Error in mounted hook: "TypeError: Cannot read property 'pullToRefreshTrigger' of undefined"
Expected Behavior
I can use $f7 when the route element mounted
Actual Behavior
can't use $f7,
If you do it on initial rendering (home page), do it in onF7Init method:
methods: {
onF7Init() {
var homeElement = this.$refs.homeContainer.$el
this.$f7.pullToRefreshTrigger(homeElement)
}
}
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.