Add the create button via vuejs

parent 93b5634f
<template> <template>
<data-tables :data="data"> <data-tables :data="data" :actions-def="actionsDef">
<el-table-column prop="id" label="Id" width="100"> <el-table-column prop="id" label="Id" width="100">
</el-table-column> </el-table-column>
<el-table-column prop="title" label="Title"> <el-table-column prop="title" label="Title">
...@@ -27,6 +27,15 @@ ...@@ -27,6 +27,15 @@
data() { data() {
return { return {
data, data,
actionsDef: {
def: [{
name: 'Create a page',
icon: 'edit',
handler: () => {
window.location = route('admin.page.page.create');
}
}]
}
} }
}, },
methods: { methods: {
......
...@@ -13,21 +13,10 @@ ...@@ -13,21 +13,10 @@
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="row">
<div class="btn-group pull-right" style="margin: 0 15px 15px 0;">
<a href="{{ URL::route('admin.page.page.create') }}" class="btn btn-primary btn-flat" style="padding: 4px 10px;">
<i class="fa fa-pencil"></i> {{ trans('page::pages.button.create page') }}
</a>
</div>
</div>
<div class="box box-primary"> <div class="box box-primary">
<div class="box-header">
</div>
<!-- /.box-header -->
<div class="box-body"> <div class="box-body">
<page-table></page-table> <page-table></page-table>
</div> </div>
<!-- /.box -->
</div> </div>
</div> </div>
</div> </div>
......
...@@ -69213,7 +69213,16 @@ var _data = void 0; ...@@ -69213,7 +69213,16 @@ var _data = void 0;
/* harmony default export */ __webpack_exports__["default"] = ({ /* harmony default export */ __webpack_exports__["default"] = ({
data: function data() { data: function data() {
return { return {
data: _data data: _data,
actionsDef: {
def: [{
name: 'Create a page',
icon: 'edit',
handler: function handler() {
window.location = route('admin.page.page.create');
}
}]
}
}; };
}, },
...@@ -69240,7 +69249,8 @@ var _data = void 0; ...@@ -69240,7 +69249,8 @@ var _data = void 0;
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('data-tables', { return _c('data-tables', {
attrs: { attrs: {
"data": _vm.data "data": _vm.data,
"actions-def": _vm.actionsDef
} }
}, [_c('el-table-column', { }, [_c('el-table-column', {
attrs: { attrs: {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment