12345678910111213141516171819202122232425 |
- import { Component, OnInit } from '@angular/core';
- // 由于Parse本身是js库,在ts中加载需要通过 * as Parse转换一下
- import * as Parse from "parse"
- @Component({
- selector: 'app-mine',
- templateUrl: './mine.page.html',
- styleUrls: ['./mine.page.scss'],
- })
- export class MinePage implements OnInit {
- // 由于Parse.User.current()是随着localStorage变化的属性
- // 为了避免首次复制后用户状态变化,页面不同步,通过get方法实现实时获取
- get user():Parse.User|undefined{
- return Parse.User.current()
- }
- constructor() {
- }
- ngOnInit() {
- }
- logout(){
- Parse.User.logOut();
- }
- }
|