Skip to content

Why does this component emit event in Vue3 ?? #6585

Discussion options

You must be logged in to vote

The reason is v-on Listener Inheritance.

https://vuejs.org/guide/components/attrs.html#v-on-listener-inheritance

You can add inheritAttrs: false to disabling Attribute Inheritance.

https://vuejs.org/guide/components/attrs.html#disabling-attribute-inheritance

Modify the Codes:

MyGroup.vue

<template>
  <v-group :x="100" :y="100">
    <v-rect :x="0" :y="0" :width="100" :height="100" fillStyle="red" />
    <v-rect :x="50" :y="50" :width="100" :height="100" fillStyle="blue" />
  </v-group>
</template>
<script>
import VGroup from "./VGroup";
import VRect from "./VRect";
export default {
  inheritAttrs: false,
  components: { VRect, VGroup },
};
</script>

or

MyGroup.vue

<template>
  <div>
    <v…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@chamyeongdo
Comment options

@liulinboyi
Comment options

Answer selected by junholee14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants