【发布时间】:2021-06-30 03:14:54
【问题描述】:
在我的Something.vue:
<template>
<p>{{ codes }}</p>
</template>
export default {
data() {
return {
codes: 'test'
}
},
name: 'Functions',
props: {
msg: String
},
setup() {
this.codes = 'does it work?';
}
</script>
<style>
</style>
我为什么会遇到这个问题?
Uncaught TypeError: Cannot set property 'codes' of undefined
【问题讨论】:
-
您没有打开
<script>标记,并且您在代码末尾缺少一个右括号。也许是红鲱鱼?