[Vuejs]-Unable to change background-image: url of a link by jquery after axios

0👍

Finally I managed to fix it using $(document).ready(). Here is my code. Keeping this in case anyone find a use for it.

axios.get('http://api.fightpoverty.online/api/city?page=2')
                            .then(response => {
                                this.items = response.data;
                                $(document).ready(function () {
                                    $(".background-image").each(function () {
                                        $(this).css("background-image", "url(" + $(this).find("img").attr("src") + ")");
                                    });
                                });
                            });

Leave a comment