【发布时间】:2021-07-21 12:50:35
【问题描述】:
<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 is not defined”的错误
【问题讨论】: