Skip to content

Document the removal of binding.expression for directives #1133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/guide/migration/custom-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ badges:

The hook functions for directives have been renamed to better align with the component lifecycle.

Additionally, the `expression` string is no longer passed as part of the `binding` object.

## 2.x Syntax

In Vue 2, custom directives were created by using the hooks listed below to target an element’s lifecycle, all of which are optional:
Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The following consists a list of breaking changes from 2.x:
- The `destroyed` lifecycle option has been renamed to `unmounted`
- The `beforeDestroy` lifecycle option has been renamed to `beforeUnmount`
- [Props `default` factory function no longer has access to `this` context](/guide/migration/props-default-this.html)
- [Custom directive API changed to align with component lifecycle](/guide/migration/custom-directives.html)
- [Custom directive API changed to align with component lifecycle and `binding.expression` removed](/guide/migration/custom-directives.html)
- [The `data` option should always be declared as a function](/guide/migration/data-option.html)
- [The `data` option from mixins is now merged shallowly](/guide/migration/data-option.html#mixin-merge-behavior-change)
- [Attributes coercion strategy changed](/guide/migration/attribute-coercion.html)
Expand Down