Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

currentユーザーのstoreの作成 #35

Closed
kuroro-31 opened this issue Feb 6, 2022 · 2 comments
Closed

currentユーザーのstoreの作成 #35

kuroro-31 opened this issue Feb 6, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@kuroro-31
Copy link
Owner

No description provided.

@kuroro-31 kuroro-31 added the documentation Improvements or additions to documentation label Feb 6, 2022
@kuroro-31
Copy link
Owner Author

マイページは
・マイコース
・受講中のコース
・お気に入り
・ アーカイブ
・設定
・願いの泉

などページ自体の構成は同じだがURL遷移するようになっている。

URL遷移でいちいちデータ取得すると重いので、currentUserとしてstoreに保存して軽くする。
currentUserがnullの際にデータ取得をするように設定した

@kuroro-31 kuroro-31 changed the title 投稿者ユーザーのvuexを作る currentユーザーのstoreの作成 Feb 12, 2022
@kuroro-31
Copy link
Owner Author

kuroro-31 commented Feb 12, 2022

currentUserがnullの場合、
またはcurrentUserの名前と指定ユーザーパラメータが違った場合にデータ取得を実行する

if (this.currentUser == null || this.currentUser.name != this.name) {
    this.getCurrentUser()
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant