framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

FrameworkVue,access $f7 in route element monted lifecycle

Open Wolferring opened this issue 9 years ago • 2 comments

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,

Wolferring avatar Oct 17 '17 03:10 Wolferring

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)
  }
}

nolimits4web avatar Oct 17 '17 08:10 nolimits4web

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.

lock[bot] avatar Jun 24 '18 21:06 lock[bot]