Invalid value for option “methods”: expected an Object, but got Function. 大致错误信息为: methods 希望是一个对象,但是得到了一个函数
methods(){ test(){ console.log(this.student); } }
methods:{ test(){ console.log(this.student); } }
根据报错翻译大致意思判断出是关于methods的错误,就去methods附近找错,极大概率是语法写错,多写括号或少写。