Foo-options.uvue 937 字节
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
<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>

DCloud-WZF's avatar
DCloud-WZF 已提交
18 19 20 21 22
<script lang="uts">
  export type FooPropsObj = {
    name : string
  }
  
DCloud-WZF's avatar
DCloud-WZF 已提交
23 24 25 26 27 28 29 30 31
  export default {
    props: {
      title: {
        type: String,
        default: ''
      },
      num: {
        type: Number,
        default: 0
32 33 34 35
      },
      checked: {
        type: Boolean,
        default: false
DCloud-WZF's avatar
DCloud-WZF 已提交
36 37
      },
      obj: {
DCloud-WZF's avatar
DCloud-WZF 已提交
38
        type: FooPropsObj,
DCloud-WZF's avatar
DCloud-WZF 已提交
39 40 41 42 43
        required: true
      }
    }
  }
</script>