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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ac48-2af82.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ac48-2af82.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?