computed:{
...mapState({
user: state=>state.user,
token:state=>state.token,
teachers:state=>state.teachers
})
},
mounted(){
console.log('this.teachers',this.teachers)
if(this.teachers.length == 0){
this.getTeachers();
}
},
已经解决了,是我引用 错了,应该是: