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

API からデータが返ってくるまで画面にロード中を示すスピナーを表示しておく #1873

Open
1 task
tsuna-can-se opened this issue Jan 20, 2025 · 2 comments
Assignees
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある
Milestone

Comments

@tsuna-can-se
Copy link
Contributor

概要

Dressca Admin のフロントエンドにおいて、
API からデータが返ってくるまで、画面の表示が変な状態になってしまう。
そのため、API からデータが返ってくるまで画面にロード中を示すスピナーを表示しておくように修正する。

詳細 / 機能詳細(オプション)

Consumer については以前下記のissueにて対応した。
ただ、Consumer内にも未対応の画面があった場合は、別途issueを作成して対応する。

完了条件

  • API でのデータ取得中、画面の表示が変にならないこと(スピナーが表示されること)
@tsuna-can-se tsuna-can-se added the target: Dressca サンプルアプリケーションDresscaに関係がある label Jan 20, 2025
@tsuna-can-se tsuna-can-se added this to the v1.1.0 milestone Jan 20, 2025
@kenjiyoshid-a
Copy link
Contributor

Consumerについて、カタログアイテムの一覧のViewファイルであるCatalogView.vueのローディング・スピナーの表示・非表示の制御が不完全であるように見える。

onMounted(async () => {
  state.showLoading = true;
  // 省略
  try {
    await fetchItems(selectedCategory.value, selectedBrand.value);
  } catch (error) {
    // 省略
  }
  state.showLoading = false;
});

以下のようにfinally句に state.showLoading = false;を含めるように変更する。

onMounted(async () => {
  state.showLoading = true;
  // 省略
  try {
    await fetchItems(selectedCategory.value, selectedBrand.value);
  } catch (error) {
    // 省略
  } finally{
    state.showLoading = false;
  }
});

@kenjiyoshid-a
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある
Projects
None yet
Development

No branches or pull requests

2 participants