Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

b-img-lazy can not load async backend called binary image data#7171

Unanswered
srknkcn asked this question inQ&A
Discussion options

URL based source is working. But when we changed with async loading from S3 bucket gives promise errors

<b-overlay :show="spinnerShow">    <div>        <b-card>            <b-row v-for="photorow in photoRowCount">                <b-col><b-img-lazy v-bind="mainProps" :src="getImageUrl(80)" alt="Image 1"></b-img-lazy></b-col>                <b-col><b-img-lazy v-bind="mainProps" :src="getImageUrl(12)" alt="Image 2"></b-img-lazy></b-col>                <b-col><b-img-lazy v-bind="mainProps" :src="getImageUrl(12)" alt="Image 3"></b-img-lazy></b-col>                <b-col><b-img-lazy v-bind="mainProps" :src="getImageUrl(13)" alt="Image 4"></b-img-lazy></b-col>                <b-col><b-img-lazy v-bind="mainProps" :src="getImageUrl(14)" alt="Image 5"></b-img-lazy></b-col>            </b-row>        </b-card>    </div></b-overlay>methods: {    async getImageUrl(imageId) {        let result = this.photoList[imageId];        let returnvalue = await mezFotoService.GetMezFotografByName(result);        return returnvalue;    }}

and in the service section

GetMezFotografByName = async (name) => {            let result = {};    const url = `${baseUrl}/api/MezFotograf/GetMezFotografByName?name=`+name;    await axios.get(url)    .then((response) => {        result = response.data.responseData;    }).catch((error) => {        console.log(error);    });    return result;}

All photos are requested and come to browser in the developer tools network screen.

You must be logged in to vote

Replies: 1 comment

Comment options

Hiws
Aug 28, 2023
Maintainer

You shouldn't call async methods in the template.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@srknkcn@Hiws

[8]ページ先頭

©2009-2025 Movatter.jp