Skip to content

Commit

Permalink
Vue user table created
Browse files Browse the repository at this point in the history
  • Loading branch information
tibi2303 committed Jun 7, 2018
1 parent b417f40 commit 84a6648
Show file tree
Hide file tree
Showing 8 changed files with 71,919 additions and 27 deletions.
14,034 changes: 14,034 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

10,417 changes: 10,415 additions & 2 deletions public/css/app.css

Large diffs are not rendered by default.

47,418 changes: 47,417 additions & 1 deletion public/js/app.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}
2 changes: 1 addition & 1 deletion resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ window.Vue = require('vue');
* or customize the JavaScript scaffolding to fit your unique needs.
*/

Vue.component('example-component', require('./components/ExampleComponent.vue'));
Vue.component('user-table', require('./components/UserTableComponent.vue'));

const app = new Vue({
el: '#app'
Expand Down
23 changes: 0 additions & 23 deletions resources/assets/js/components/ExampleComponent.vue

This file was deleted.

46 changes: 46 additions & 0 deletions resources/assets/js/components/UserTableComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card card-default">
<div class="card-header">Example Component</div>

<div class="card-body">
I'm an example component.
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
users: [],
user: {
id: '',
name: '',
email: '',
role: '',
created_at: '',
updated_at: '',
},
pagination: {}
}
},
created() {
this.fetchUsers();
},
methods: {
fetchUsers() {
fetch('api/users')
.then(res => res.json())
.then(res => {
console.log(res.data);
})
}
}
}
</script>
2 changes: 2 additions & 0 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'Test') }}</title>

Expand All @@ -13,6 +14,7 @@
<body>
<div id="app">
@yield('content')
<user-table></user-table>
</div>

<!-- Scripts -->
Expand Down

0 comments on commit 84a6648

Please sign in to comment.