Foo-composition.uvue 959 字节
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
<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
27 28 29 30
  },
  checked: {
    type: Boolean,
    default: false
DCloud-WZF's avatar
DCloud-WZF 已提交
31 32 33
  },
  obj: {
    // #ifdef APP-ANDROID
DCloud-WZF's avatar
DCloud-WZF 已提交
34
    // TODO: 确认类型是否合理
DCloud-WZF's avatar
DCloud-WZF 已提交
35 36 37 38 39 40 41 42 43
    type: FooPropsObj1ReactiveObject,
    // #endif
    // #ifdef APP-IOS || WEB
    type: Object,
    // #endif
    required: true
  }
})
</script>