Skip to content

Commit 13f7992

Browse files
committed
修改Grid Actions ,添加了获取当前行信息的方法
1 parent 1f4e02d commit 13f7992

File tree

14 files changed

+136
-120931
lines changed

14 files changed

+136
-120931
lines changed

docs/custom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ export default {
348348
},
349349
computed: {
350350
uri() {
351-
//替换变量
351+
//替换变量 ,新版已经可以在php端获取当前行对象了
352352
let uri = this.action.uri;
353353
this._.forEach(this.row, (value, key) => {
354354
uri = this._.replace(uri, "{" + key + "}", value);

docs/grid.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,11 +627,34 @@ $grid->column('permissions.roles.administrators.name')->displayComponent(Tag::ma
627627

628628
```php
629629
$grid->actions(function (Grid\Actions $actions) {
630+
631+
$actions->getKey();//获取当前行的 index v0.1.5 +
632+
633+
$actions->getRow();//获取当前行的对象,注意是对象不是数组 v0.1.5 +
634+
630635
$actions->hideEditAction();
631636
$actions->hideViewAction();
632637
})
633638
```
634639

640+
#### 获取当前行的 index
641+
642+
v0.1.5 +
643+
644+
```php
645+
$actions->getKey();
646+
```
647+
648+
#### 获取当前行的对象
649+
650+
获取当前行的对象,注意是对象不是数组 v0.1.5 +
651+
652+
```php
653+
$actions->getRow();
654+
```
655+
656+
657+
635658
#### 隐藏所有操作
636659

637660
```php

0 commit comments

Comments
 (0)