0👍
Your users
inside Data looks wrong.
Here is an edited version
Profile
<script>
import UserProfile from '../partials/UserProfile.vue'
import User from '../models/User'
import Form from '../core/Form'
export default {
components: {
UserProfile
},
data() {
return {
users: [
{
name: 'FirstName LastName',
email: 'firstname.lastname@gmail.com'
}
],
}
},
created() {
// User.all(users => this.users = users)
}
};
</script>
- [Vuejs]-How to save category in laravel 5.7 with vue.js
- [Vuejs]-How to return vue.js 'Created' value
0👍
Since you’re only returning the currently logged in user, you’ll have to edit your Profile
component a bit:
<template>
<div>
<h3>Profile</h3>
<user-profile :user="user" :key="user.id"></user-profile>
</div>
</template>
<script>
import UserProfile from '../partials/UserProfile.vue'
import User from '../models/User'
import Form from '../core/Form'
export default {
components: {
UserProfile
},
data() {
return {
user: {},
}
},
created() {
axios.get('/user/profile').then(res => this.user = res);
}
};
</script>
Source:stackexchange.com