質問編集履歴
2
前提文修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
### 前提
|
5
5
|
Nuxtで作成している画面で、画像ファイルを表示させようとしています。
|
6
6
|
ファイルパスを指定してAPIを呼び出し、当該パスにある画像ファイルのデータを返す仕組みとしています。
|
7
|
+
Vue.jsやNuxtを触り始めて1ヶ月ほどで分からぬことも多く試行錯誤ばかりなのですが、よろしくおねがいします。
|
7
8
|
|
8
9
|
しかし、以下のような問題が発生しています。
|
9
10
|
|
1
ソースコードに追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,6 +23,8 @@
|
|
23
23
|
return {
|
24
24
|
imageContent: null,
|
25
25
|
・・・
|
26
|
+
async mounted() {
|
27
|
+
|
26
28
|
const imagePath = this.item.image_path;
|
27
29
|
const imageResponse = await this.$axios.get(`/api/imagecontent?path=${encodeURIComponent(imagePath)}`, { responseType: 'blob' });
|
28
30
|
const imageContent = URL.createObjectURL(imageResponse.data); // 画像ファイルのデータは返ってきているように見えている
|