export default {
props:{
to:{
type:String,
required:true
},
tag:{
type:String
}
},
render(h){
const tag = this.tag || 'a';
const handler = ()=>{
this.$router.push(this.to);
}
// this.$slots.default 默认插槽
return <tag onClick={handler}>{this.$slots.default}</tag>
}
}
$vnode和_vnode的区别