vue子组件点击事件@click无效

父组件

<template>
    <div>
       <Button @click.native="Show()" />
    </div>
</template>
<script>
import Button from '../components/Button.vue'
export default {
    components: {
        Button,
    },
    methods: {
        Show() {//使用@click.native触发就可以解决问题
            this.ruleHide = true
        },
    }
}
</script>

猜你喜欢

转载自blog.csdn.net/m0_60322614/article/details/128670139
今日推荐