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

async method in v-for? #10

Open
RezaErfani67 opened this issue Apr 19, 2020 · 2 comments
Open

async method in v-for? #10

RezaErfani67 opened this issue Apr 19, 2020 · 2 comments

Comments

@RezaErfani67
Copy link

can i call async method in v-for?

@AlbertBrand
Copy link
Owner

Yes. But keep in mind that each component you render in v-for will trigger a separate network call. Also, if the list is often updated, this is again trigger individual network calls.

@RezaErfani67
Copy link
Author

RezaErfani67 commented Apr 20, 2020

excellent...
can you please give me an example?

   <div  v-for="item in taskList" >
 <div v-for="(eachRow,index6) in mapGrid(item,_.clone(eachGrid))">
                  <input type="text" v-model="eachRow.text" />
 </div>
</div>

.
.
export default {
methods: {
async mapGrid(taskItem,eachGrid){
let response=await axios.get().... ;
return response;
        }
    }

}

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

No branches or pull requests

2 participants