Skip to content

输入部件 inputControl

用法

用于渲染带有前缀或后缀的输入元素

php
inputControl
(
    set::prefix('密码:'),
    set::prefixWidth('36'),
    input
    (
        set::type('password'),
        set::name('password'),
        set::placeholder('请输入密码'),
        set::required(true),
    ),
    to::suffix(icon('key')),
    set::suffixWidth('lg'),
);
html
<div class="input-control has-prefix has-suffix-lg" style="--input-control-prefix: 36px;">
    <input class="form-control is-required" type="password" autocomplete="off" name="password" placeholder="请输入密码" id="password">
    <div class="input-control-prefix">密码:</div>
    <div class="input-control-suffix">
        <i class="icon icon-key"></i>
    </div>
</div>

属性

属性名类型默认值说明
prefixmixed-前缀
suffixmixed-后缀
prefixWidth'sm'|'lg'|int-前缀宽度
suffixWidth'sm'|'lg'|int-后缀宽度

块名映射类型说明
prefix-前缀部件
suffix-后缀部件

https://zentao.net