import { Storage } from '../utils/Storage'

@Observed
export class VMTabHome {
  // 顶部用户名
  username: string = ""
  // 是否刷新中
  isRefreshing: boolean = false

  /**
   * 初始化首页数据
   */
  init() {
    // 更新用户名
    this.username = Storage.getUsername()
  }

  onRefresh() {
    this.isRefreshing = true
    setTimeout(() => {
      this.isRefreshing = false
    }, 3000)
  }
}