call-easy-method-uni-modules.vue 639 字节
Newer Older
H
hdx 已提交
1
<template>
2
  <view>{{result}}</view>
H
hdx 已提交
3 4 5 6
</template>

<script>
  export default {
7
    props: {
8

9
    },
H
hdx 已提交
10 11
    data() {
      return {
12
        result: ''
H
hdx 已提交
13 14
      }
    },
15 16
    emits:['propsChanged'],
    watch: {
17

18
    },
H
hdx 已提交
19 20
    methods: {
      foo1() {
21
        this.result = "foo1"
H
hdx 已提交
22
      },
23 24
      foo2(date1: number) {
        this.result = "foo2=" + date1
H
hdx 已提交
25
      },
26 27
      foo3(date1: number, date2: number) {
        this.result = "foo3=" + date1 + " " + date2
H
hdx 已提交
28
      },
29
      foo4(callback: (() => void)) {
H
hdx 已提交
30 31
        callback()
      },
32
      foo5(text1: string): any | null {
33
        this.result = text1
H
hdx 已提交
34 35 36 37
        return text1
      }
    }
  }
38
</script>