button 新增按钮权限功能
This commit is contained in:
@@ -5,7 +5,13 @@ class Button extends Component
|
||||
{
|
||||
protected $el = 'button';
|
||||
|
||||
|
||||
/**
|
||||
* icon
|
||||
*
|
||||
* @time 2021年05月07日
|
||||
* @param string $icon
|
||||
* @return $this
|
||||
*/
|
||||
public function icon(string $icon): Button
|
||||
{
|
||||
$this->attributes['icon'] = $icon;
|
||||
@@ -13,6 +19,13 @@ class Button extends Component
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字
|
||||
*
|
||||
* @time 2021年05月07日
|
||||
* @param string $text
|
||||
* @return $this
|
||||
*/
|
||||
public function text(string $text): Button
|
||||
{
|
||||
$this->attributes['label'] = $text;
|
||||
@@ -20,6 +33,13 @@ class Button extends Component
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 样式
|
||||
*
|
||||
* @time 2021年05月07日
|
||||
* @param string $style
|
||||
* @return $this
|
||||
*/
|
||||
public function style(string $style): Button
|
||||
{
|
||||
$this->attributes['class'] = $style;
|
||||
@@ -27,6 +47,13 @@ class Button extends Component
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
*
|
||||
* @time 2021年05月07日
|
||||
* @param string $click
|
||||
* @return $this
|
||||
*/
|
||||
public function click(string $click): Button
|
||||
{
|
||||
$this->attributes['click'] = $click;
|
||||
@@ -34,6 +61,20 @@ class Button extends Component
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限 action 指令
|
||||
*
|
||||
* @time 2021年05月07日
|
||||
* @param string $action
|
||||
* @return $this
|
||||
*/
|
||||
public function permission(string $permission): Button
|
||||
{
|
||||
$this->attributes['permission'] = $permission;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支持路由跳转
|
||||
*
|
||||
|
Reference in New Issue
Block a user