Skip to content

Is the transition hooks' call context right? #2287

@TerenceZ

Description

@TerenceZ

If I apply a transition on a component A who isn't fragment, the transition hooks (resolved from B)' call contexts point to A, not the component B. For example following, I can't get the props I wanted to animate, because the this is pointing to inner instance, not the comp instance.

Have I missed something? Because I don't know why the context should be bound to the inner, and if I really want to access inner's props, I can access it through the $refs.inner...

<template>
<div>
  <inner transition="tran" v-show="visible"></inner>
</div>
<template>
<script>
export default {
  name: "comp",
  transitions: {
    tran: {
      enter(el, done) {
        // I want to access some props on `comp`, but the `this` points to `inner` instance:(
      }
    }
  }
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions