初始化仓库
This commit is contained in:
48
admin/components/UI/Form/Password.php
Normal file
48
admin/components/UI/Form/Password.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace admin\components\UI\Form;
|
||||
|
||||
/**
|
||||
* 密码输入器
|
||||
* @package backend\components\UI\Form
|
||||
*/
|
||||
class Password extends Element implements Component
|
||||
{
|
||||
protected Text $object;
|
||||
|
||||
/**
|
||||
* Text constructor.
|
||||
* @param string $name
|
||||
* @param string $field
|
||||
* @param string $has
|
||||
*/
|
||||
public function __construct(string $name, string $field, string $has = '')
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->field = $field;
|
||||
$this->has = $has;
|
||||
$this->attr['placeholder'] = null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function render(): array
|
||||
{
|
||||
$data = [
|
||||
'nodeName' => 'a-input-password',
|
||||
'vModel:modelValue' => $this->getModelField(),
|
||||
'placeholder' => $this->attr['placeholder'] ?: '请输入' . $this->name,
|
||||
'allowClear' => true
|
||||
];
|
||||
|
||||
if($this->replace != ''){
|
||||
$data['vStringReplace'] = $this->replace;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user