初始化仓库
This commit is contained in:
42
admin/components/UI/Table/Column/Hidden.php
Normal file
42
admin/components/UI/Table/Column/Hidden.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace admin\components\UI\Table\Column;
|
||||
|
||||
|
||||
/**
|
||||
* Class Hidden
|
||||
*/
|
||||
class Hidden implements Component
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $label
|
||||
* @return array
|
||||
*/
|
||||
public function render($label): array
|
||||
{
|
||||
$name = $label . '_show';
|
||||
return [
|
||||
'nodeName' => 'div',
|
||||
'child' => [
|
||||
[
|
||||
'nodeName' => 'span',
|
||||
'class' => 'mr-2',
|
||||
'vIf' => "rowData.record['$name']",
|
||||
'child' => "{{rowData.record['$label']}}",
|
||||
],
|
||||
[
|
||||
'nodeName' => 'a-button',
|
||||
'shape' => 'round',
|
||||
'size' => 'mini',
|
||||
'type' => 'outline',
|
||||
'vBind:status' => "rowData.record['$name'] ? 'warning' : ''",
|
||||
'class' => 'mr-2',
|
||||
'vOn:click' => "rowData.record['$name'] = !rowData.record['$name']",
|
||||
'child' => "{{rowData.record['$name'] ? '隐藏' : '显示'}}",
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user