[Vuejs]-How do I populate auto generated input fields with Vue / Laravel

0👍

I managed to fix this by adding the following mounted method to email-preferences.js, thanks to @luceos above for the input.

mounted() {
        var items = null;
        axios.get('/dashboard/preferences/current').then((response) => {
            items = JSON.parse(response.data);

            Object.keys(items).forEach(key => {
                this.selected[key] = items[key].value;
            })
        })
    },

Leave a comment