Files
ops/uniapp/components/test_components/test_components.vue
T
kevin 9d3eb0cea9 new
Signed-off-by: kevin <kevin@lmve.net>
2025-06-05 11:04:12 +08:00

24 lines
483 B
Vue

<template>
<view>
<button type="primary" @click="sendMsg">给父组件传值</button>
</view>
</template>
<script>
export default {
data () {
return {
status: 'hello uni-app'
}
},
mounted() {
//this.$emit('myEvent',this.status) // 通过$emit触发事件,第二个参数就是传递的参数
},
methods: {
sendMsg () {
//this.$emit('myEvent',this.status) // 通过$emit触发事件,第二个参数就是传递的参数
}
}
}
</script>