Foo-composition.uvue 903 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<template>
  <view>
    <view class="flex justify-between flex-row mb-10">
      <text>props title:</text>
      <text id="foo-props-title">{{ title }}</text>
    </view>
    <view class="flex justify-between flex-row mb-10">
      <text>props num:</text>
      <text id="foo-props-num">{{ num }}</text>
    </view>
    <view class="flex justify-between flex-row mb-10">
      <text>props obj['name']:</text>
      <text id="foo-props-obj-name">{{ obj['name'] }}</text>
    </view>
  </view>
</template>

<script setup lang="uts">
defineProps({
  title: {
    type: String,
    default: ''
  },
  num: {
    type: Number,
    default: 0
  },
  obj: {
    // #ifdef APP-ANDROID
DCloud-WZF's avatar
DCloud-WZF 已提交
30
    // TODO: 确认类型是否合理
DCloud-WZF's avatar
DCloud-WZF 已提交
31 32 33 34 35 36 37 38 39
    type: FooPropsObj1ReactiveObject,
    // #endif
    // #ifdef APP-IOS || WEB
    type: Object,
    // #endif
    required: true
  }
})
</script>