<script setup>
import { defineProps, computed } from '@vue/runtime-core'
defineProps({
foo: Array,
})
const length = computed(() => {
return foo.length // foo is not defined
})
</script>
在这个完全不言自明的块中,当我尝试在计算中到达 props 变量时,会抛出一个错误,例如“未定义 foo”