Logo white

BJ_web_developers / jy_parkingOS

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • jy_parkingOS
  • pages
  • template
  • component-communication
  • sender.vue
  • 江阴初始化项目
    4b045f7c
    刘淇 authored
    2022-05-08 12:58:21 +0800  
    Browse Code »
sender.vue 488 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<template>
    <view class="sender-container">
        <button type="primary" @click="send">点击发送消息</button>
    </view>
</template>

<script>
    export default {
        methods: {
            send() {
                let num = parseInt(Math.random() * 10000)
                uni.$emit('cc', {
                    msg: 'From uni.$emit -> ' + num
                })
            }
        }
    }
</script>

<style>
    .sender-container{
        padding: 20px;
    }
</style>