Skip to content

Commit

Permalink
docs: update listview demo
Browse files Browse the repository at this point in the history
  • Loading branch information
paranoidjk authored and lixiaoyang1992 committed Apr 26, 2018
1 parent b19117a commit 19e1d0b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions site/kitchen/src/template/KitchenSink/Demo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ import { getQuery } from '../../../../utils';
export default class Demo extends React.Component {
goToPage = (name, index) => () => {
location.hash = `${name}-demo-${index}`;
}
update = () => {
this.forceUpdate();
}
componentDidMount() {
window.addEventListener('hashchange', this.update, false);
}
componentWillUnMount() {
window.removeEventListener('hashChange', this.update, false);
}
render() {
const { demos, location, picked, themeConfig: config, locale } = this.props;
let demoMeta;
Expand Down

0 comments on commit 19e1d0b

Please sign in to comment.