Blame view

pages/template/component-communication/sender.vue 488 Bytes
4b045f7c   刘淇   江阴初始化项目
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>