Skip to content

Document new emits: option and component event behaviour / removal of .native modifier #592

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

Closed
LinusBorg opened this issue Oct 4, 2020 · 1 comment · Fixed by #608
Closed
Assignees

Comments

@LinusBorg
Copy link
Member

We can now use emits: to define the events emitted by our components.

this sounds like an additional feature but really is necessary if you don't want to have custom event listeners be attached to the root node.

  • The .native modifier for component event listeners was removed
  • All events on a component will be added to the root element unless explicitly specified as component emitted events with the emits option:
<my-component @changed="handleThisCustomEvent" @click="handleThisNatieClick"  /> 
<template>
  <div>
    <!-- the click listener will be applied to this div, but the `changed` listener will not  -->
  </div>
</template>

<script>
export default {
  emits: ['changed']
}
</script>
@skirtles-code
Copy link
Contributor

Related: #526.

@LinusBorg LinusBorg self-assigned this Oct 7, 2020
NataliaTepluhina pushed a commit that referenced this issue Oct 23, 2020
…526,#592) (#608)

* feat: Add migration guide for 3 changes:
- $listeners removed
- v-on.native modifier removed
- new emits option

* feat: document $attrs new behaviour
now includes class and style behaviour.

* fix: typos, grammar and language improvements

* more fixes

* Update src/guide/migration/emits-option.md

* Update src/guide/migration/introduction.md

fix broken link

* Update src/guide/migration/listeners-removed.md

fix broken link

Co-authored-by: skirtle <[email protected]>

* Update src/guide/migration/introduction.md

fix broken link

Co-authored-by: skirtle <[email protected]>

* Update src/guide/migration/emits-option.md

typo

* Update src/guide/migration/listeners-removed.md

grammar

* Update src/guide/migration/listeners-removed.md

wording

* Update src/guide/migration/v-on-native-modifier-removed.md

* Update src/guide/migration/emits-option.md

fix broken link

* Update src/guide/migration/introduction.md

fix broken link

* still more mistakes to fix.

* fix link to api docs for "emits:"

* use vue instead of html as hightligh lang where possible

* fix broken link

* fix missing template content

* wording/grammar

Co-authored-by: Thorsten Luenborg <[email protected]>
Co-authored-by: skirtle <[email protected]>
nick-lai pushed a commit to nick-lai/docs-next that referenced this issue Dec 2, 2020
…uejs#526,vuejs#592) (vuejs#608)

* feat: Add migration guide for 3 changes:
- $listeners removed
- v-on.native modifier removed
- new emits option

* feat: document $attrs new behaviour
now includes class and style behaviour.

* fix: typos, grammar and language improvements

* more fixes

* Update src/guide/migration/emits-option.md

* Update src/guide/migration/introduction.md

fix broken link

* Update src/guide/migration/listeners-removed.md

fix broken link

Co-authored-by: skirtle <[email protected]>

* Update src/guide/migration/introduction.md

fix broken link

Co-authored-by: skirtle <[email protected]>

* Update src/guide/migration/emits-option.md

typo

* Update src/guide/migration/listeners-removed.md

grammar

* Update src/guide/migration/listeners-removed.md

wording

* Update src/guide/migration/v-on-native-modifier-removed.md

* Update src/guide/migration/emits-option.md

fix broken link

* Update src/guide/migration/introduction.md

fix broken link

* still more mistakes to fix.

* fix link to api docs for "emits:"

* use vue instead of html as hightligh lang where possible

* fix broken link

* fix missing template content

* wording/grammar

Co-authored-by: Thorsten Luenborg <[email protected]>
Co-authored-by: skirtle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants