{"size": 833, "ext": "js", "max_stars_repo_path": "packages/omi-router/examples/simple/user.js", "max_stars_repo_name": "fyuan1992/omi", "max_stars_repo_stars_event_min_datetime": "2018-12-12T06:42:40.000Z", "max_stars_repo_stars_event_max_datetime": "2018-12-12T16:34:00.000Z", "max_issues_repo_path": "packages/omi-router/examples/simple/user.js", "max_issues_repo_name": "fyuan1992/omi", "max_issues_repo_issues_event_min_datetime": "2020-07-17T16:10:55.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-09T22:57:18.000Z", "max_forks_repo_path": "packages/omi-router/examples/simple/user.js", "max_forks_repo_name": "fyuan1992/omi", "max_forks_repo_forks_event_min_datetime": "2021-09-07T09:19:23.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-07T09:19:23.000Z"}
{"max_stars_count": 4, "max_issues_count": 2, "max_forks_count": 1, "avg_line_length": 20.825, "max_line_length": 64, "alphanum_fraction": 0.5246098439}
﻿import { WeElement, define } from 'omi'


define('my-user', class extends WeElement {

  beforeRender() {
    let params = this.props.params
    this.name = params.name

    this.category = params.category
    this.info = this.queryInfo(this.name)
    this.age = this.info.age
    this.sex = this.info.sex
  }

  queryInfo(name) {
    this.mockData = {
      'yanagao': { age: 18, sex: 'female' },
      'vorshen': { age: 20, sex: 'male' },
      'dntzhang': { age: 22, sex: 'male' }
    }
    return this.mockData[name]
  }

  render() {
    return (
      <div >
        <button onclick={() => { history.back() }}>back</button>
        <ul>
          <li>name:{this.name}</li>
          <li>age:{this.age}</li>
          <li>sex:{this.sex}</li>
          <li>category:{this.category}</li>
        </ul>
      </div>
    )

  }
})
