官网的解释:
你可能想在某个组件的根元素上监听一个原生事件。可以使用 v-on 的修饰符 .native 。
通俗来讲:就是在父组件中给自定义的子组件绑定一个原生的事件,不加’. native’事件是无法触 发的,如下图
<template><view><TestValue style="color:red" title="hahhaha" @click.native="clickChild" /></view></template>
<script>import TestValue from '@/components/TestValue.vue'export default {components:{TestValue},data() {return {title: 'Hello'}},onLoad() {},methods: {clickChild(){uni.showToast({title:"这是个子组件的事件"})}}}</script>