0
点赞
收藏
分享

微信扫一扫

[Vue warn]: Property or method “c“ is not defined on the instance but referenced during render. Make

辰鑫chenxin 2022-01-20 阅读 109
vue.js前端

[Vue warn]: Property or method “c” is not defined on the instance but referenced during render. Make sure that this prop
[Vue warn]:属性或方法“c”没有在实例中定义,而是在呈现时被引用。确保这个道具
错误就是数据没有绑定

<div v-for="tao in courses" :key="tao" :class="{active:selectedCourse === c }" @click="selectedCourse = c">
        {{ tao }}
    </div>

下面是Vue代码

 const app = new Vue({
            el:'#app',
            data(){
                return{
                    title:"hello vue",
                    course: '',
                    selectedCourse:'',
                    courses: ['123','234']
                }
            }

其实只需要把active部分的c改成tao就解决了

举报

相关推荐

0 条评论