In this step, we are going to write the <script> section of the single file component:
- Open the List.vue file in the users folder inside the views folder.
- Import the newly created Users List component, from the components folder:
import changeRouteMixin from '@/mixin/changeRoute';
import UserTableList from '@/components/userList';
- In the export default JavaScript object, add a new property called components. Declare the property as a JavaScript object, and add the imported UserTableList component to the object:
components: { UserTableList },
- In the methods property, at the getAllUsers function, we need to change the content to execute a Vuex dispatch when called. This method will perform the fetchUsersList Vuex action:
async getAllUsers() {
this.$store.dispatch('fetchUsersList');
},
- Finally, in the deleteUser function, we need to change the content to execute a Vuex dispatch when called. This method...