This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.component('vue-pagination', require('./components/Pagination.vue')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elixir = require('laravel-elixir'); | |
require('laravel-elixir-vue-2'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Elixir Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Elixir provides a clean, fluent API for defining some basic Gulp tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::get('user/api',[ | |
'as' => 'user.api', | |
'uses' => 'API\UserApiController@index' | |
]); | |
Route::get('users',[ | |
'as' => 'users.index', | |
'uses' => 'UserController@index' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\API; | |
use App\Http\Controllers\Controller; | |
use App\User; | |
/** | |
* Class UserApiController | |
* @package App\Http\Controllers\API | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
/** | |
* Class UserController | |
* @package App\Http\Controllers | |
*/ | |
class UserController extends Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<button @click="alertData('Hello')">Click Me</button> | |
<post :title="title" :author="author" :content="content"></post> | |
</div> | |
<template id="post-template"> | |
<h1>{{ title }}</h1> | |
<h4>{{ author }}</h4> | |
<p>{{ content }}</p> | |
<small>Data From component {{ component }}</small> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.Event = new Vue(); | |
Vue.component('post', { | |
template: '#post-template', | |
props: ['title', 'author', 'content'], | |
created(){ | |
let vm0 = new Vue(); | |
Event.$on('alertData',this.alertData); | |
}, | |
methods:{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./bootstrap'); | |
import VuePagination from './components/Pagination.vue'; | |
import axios from 'axios'; | |
axios.defaults.headers.common = { | |
'X-Requested-With': 'XMLHttpRequest', | |
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content') | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('content') | |
<div class="container"> | |
<table class="table table-bordered"> | |
<tr> | |
<th>Name</th> | |
<th>Email</th> | |
<th>Created At</th> | |
</tr> | |
<tr v-for="user in users.data"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<vue-pagination :pagination="users" | |
@paginate="getUsers()" | |
:offset="4"> | |
</vue-pagination> |
OlderNewer