Why didn't vue respond to this click?

there are two child components, Nav and Down, in the parent component. I want to click on the control Down of Nav to hide, but there is no response or report any error after clicking. Why?

<div id="right">
    <Nav @click="ddshow"></Nav>
</div>
<div id="down">
    <Down v-if="dd"></Down>
</div>


<script>
export default {
  data () {
    return {
      dd: true
    }
  },
  methods: {
   ddshow: function () {
      this.dd = !this.dd
   }
  }
}

</script>
Jun.17,2021

all events bound in a component should be events that exist in the component itself, otherwise you won't be able to add event listeners.

for example, your Nav component looks like this:

<template>
  <div class="nav" @click="onClick">
    nav
  </div>
</template>
<script>
export default {
  methods: {
    onClick() {
      this.$emit('click');
    }
  }
}
</script>
For more information, please see the vue documentation: ide/components-custom-events.html" rel=" nofollow noreferrer "> Portal


you can try @ click.native= "ddshow". Bind native events


you Nav components can only put custom events, take a closer look at the event delivery of parent and child components.

Menu