|
| 1 | +<template> |
| 2 | + <div id="countValue">{{ countValue }}</div> |
| 3 | + <div id="oneLayerCountObjectValue">{{ oneLayerCountObjectValue }}</div> |
| 4 | + <div id="twoLayersCountObjectValue">{{ twoLayersCountObjectValue }}</div> |
| 5 | + <div id="countArrayValue">{{ countArrayValue }}</div> |
| 6 | + <div id="countMatrixValue">{{ countMatrixValue }}</div> |
| 7 | + <div id="oneLayerCountObjectArrayValue"> |
| 8 | + {{ oneLayerCountObjectArrayValue }} |
| 9 | + </div> |
| 10 | + <div id="oneLayerCountArrayObjectValue"> |
| 11 | + {{ oneLayerCountArrayObjectValue }} |
| 12 | + </div> |
| 13 | + <div id="oneLayerCountObjectMatrixValue"> |
| 14 | + {{ oneLayerCountObjectMatrixValue }} |
| 15 | + </div> |
| 16 | +</template> |
| 17 | + |
| 18 | +<script setup lang="ts"> |
| 19 | +import { computed, Ref } from 'vue' |
| 20 | +
|
| 21 | +type Props = { |
| 22 | + count: Ref<number> |
| 23 | + oneLayerCountObject: { count: Ref<number> } |
| 24 | + twoLayersCountObject: { oneLayerCountObject: { count: Ref<number> } } |
| 25 | +
|
| 26 | + countArray: Ref<number>[] |
| 27 | + countMatrix: Ref<number>[][] |
| 28 | +
|
| 29 | + oneLayerCountObjectArray: { count: Ref<number> }[] |
| 30 | + oneLayerCountArrayObject: { count: Ref<number>[] } |
| 31 | + oneLayerCountObjectMatrix: { count: Ref<number> }[][] |
| 32 | +} |
| 33 | +
|
| 34 | +const props = defineProps<Props>() |
| 35 | +const countValue = computed(() => props.count.value) |
| 36 | +const oneLayerCountObjectValue = computed( |
| 37 | + () => props.oneLayerCountObject.count.value |
| 38 | +) |
| 39 | +const twoLayersCountObjectValue = computed( |
| 40 | + () => props.twoLayersCountObject.oneLayerCountObject.count.value |
| 41 | +) |
| 42 | +
|
| 43 | +const countArrayValue = computed(() => props.countArray[0].value) |
| 44 | +const countMatrixValue = computed(() => props.countMatrix[0][0].value) |
| 45 | +
|
| 46 | +const oneLayerCountObjectArrayValue = computed( |
| 47 | + () => props.oneLayerCountObjectArray[0].count.value |
| 48 | +) |
| 49 | +const oneLayerCountArrayObjectValue = computed( |
| 50 | + () => props.oneLayerCountArrayObject.count[0].value |
| 51 | +) |
| 52 | +const oneLayerCountObjectMatrixValue = computed( |
| 53 | + () => props.oneLayerCountObjectMatrix[0][0].count.value |
| 54 | +) |
| 55 | +</script> |
0 commit comments