import React, { Component } from 'react'
import Link from 'next/link'
import Router from 'next/router'
class you extends Component {
constructor(props) {
super(props)
this.state = {
title: 'hahah'
}
}
componentWillMount() {
console.log(222)
}
change = () => {
console.log(1)
console.log(Router)
Router.push('/')
}
render() {
return (
<div className="you">
<Link href="/">
<div>to Index</div>
</Link>
{this.state.title}
<button onClick={this.change}>点击啊</button>
</div>
)
}
}
export default you