Skip to content
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

fix: "props" and "emits" has been merged. #6933

Closed
wants to merge 4 commits into from
Closed

Conversation

ysy945
Copy link
Contributor

@ysy945 ysy945 commented Oct 23, 2022

The "props" and "emits" attributes have been merged when creating component instances, so there is no need to merge them here. It's OK to directly reference the previously merged values.
If I declare "emits" and "mixins" at the same time and then access the "emits" attribute through "this. $options" in "setup", the accessed "emits" attribute will not be merged.

<script>
import { h } from "vue";
export default {
  setup() {
    return function () {
      console.log(this.$options);
      return h("div", null, 123);
    };
  },
  emits: ["he"],
  mixins: [
    {
      emits: ["hello"],
    },
  ],
};
</script>
  • before updating
    %$1Z (DLE@WHPU)IJU2`~CG
  • after updating the attributes of "emits" is right
    @ ZCL6IG)IJ)A A%~YBL8EH

The "props" and "emits" attributes have been merged when creating component instances, so there is no need to merge them here. It's OK to directly reference the previously merged values
@netlify
Copy link

netlify bot commented Oct 23, 2022

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 1a408b0
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/63556c6da286cd00081db4b9

@netlify
Copy link

netlify bot commented Oct 23, 2022

Deploy Preview for vuejs-coverage failed.

Name Link
🔨 Latest commit 1a408b0
🔍 Latest deploy log https://app.netlify.com/sites/vuejs-coverage/deploys/63556c6d20fb150008f514b0

Copy link
Contributor Author

@ysy945 ysy945 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haoqunjiang
Copy link
Member

Already fixed in #8052

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

2 participants