用typeof
if(name=='' || typeof(name) =='undefined'){
this.$router.back(-1)
}else{
this.$router.push({name:name})
}
用typeof
if(name=='' || typeof(name) =='undefined'){
this.$router.back(-1)
}else{
this.$router.push({name:name})
}