array-literal-options.uvue 1.3 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1
<template>
D
DCloud_LXH 已提交
2
  <view>
DCloud-WZF's avatar
DCloud-WZF 已提交
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
    <text class="mb-10 bold">array literal</text>
    <view class="mb-10 flex justify-between flex-row">
      <text>str: </text>
      <text id="array-literal-str">{{ str }}</text>
    </view>
    <view class="mb-10 flex justify-between flex-row">
      <text>num: </text>
      <text id="array-literal-num">{{ num }}</text>
    </view>
    <view class="mb-10 flex justify-between flex-row">
      <text>bool: </text>
      <text id="array-literal-bool">{{ bool }}</text>
    </view>
    <view class="mb-10 flex justify-between flex-row">
      <text>obj: </text>
      <text id="array-literal-obj">{{ JSON.stringify(obj) }}</text>
    </view>
    <view class="mb-10 flex justify-between flex-row">
      <text>arr: </text>
      <text id="array-literal-arr">{{ JSON.stringify(arr) }}</text>
    </view>
  </view>
</template>

<script lang="uts">
export default {
  props: ['str', 'num', 'bool', 'obj', 'arr'],
D
DCloud_LXH 已提交
30 31 32 33 34 35 36 37
  mounted() {
    console.log('this.$props is Map', this.$props, this.$props instanceof Map);
    console.log('this.$props.str: ',this.$props['str']);
    console.log('this.$props.num: ',this.$props['num']);
    console.log('this.$props.bool: ',this.$props['bool']);
    console.log('this.$props.arr: ',this.$props['arr']);
    console.log('this.$props.obj: ',this.$props['obj']);
  }
DCloud-WZF's avatar
DCloud-WZF 已提交
38 39
};
</script>