49 lines
1008 B
PHP
49 lines
1008 B
PHP
<?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;
|
|
}
|
|
|
|
|
|
}
|