cv-input-password 输入框 ¶
简要 ¶
密码输入
属性为text
且 @password属性为true
的input
本组件一般用于隐藏密码内容的输入框
密码输入框,一般和表单配合使用,默认为实心白色背景。
示例 ¶
vue
<template>
<view class="content">
<view class="components-title">
<view class="components-title-t">cv-input-password</view>
<view class="components-title-d">密码输入框</view>
</view>
<cv-form-base ref="refFormBase" :rules="formRules" :model="formData" style="padding: 0 10px">
<cv-form-item label="密码" required>
<cv-input-password v-model="formData.password" placeholder="请输入您的密码" clearable />
</cv-form-item>
<cv-form-item label="密码" required>
<cv-input-password v-model="formData.password" placeholder="请输入您的密码" clearable />
<template v-slot:tip>请输入八位以上字符作为您的安全密码</template>
</cv-form-item>
<cv-form-item label="密码" labelPosition="top">
<cv-input-password v-model="formData.password" placeholder="请输入您的密码" clearable />
<template v-slot:tip>请输入八位以上字符作为您的安全密码</template>
</cv-form-item>
</cv-form-base>
</view>
</template>
<script>
export default {
data() {
return {
formRules: {},
formData: {
password: ''
}
};
},
onLoad() {
setTimeout(() => {
this.$testReqMock().then((res) => {
this.formData.password = '443366';
});
console.log('模拟请求数据', this.formData);
}, 1000);
},
methods: {
bindTimeChange(e) {},
clickTest(e) {
console.log(this.formData.password);
}
}
};
</script>
属性 ¶
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
v-model | String | - | 数据双向绑定 |
placeholder | String | - | 占位符 |
disabled | Boolen | false | 是否禁止 |
maxlength | Number | -1 | 输入长度限制 |
clearable | Boolean | false | 是否显示一键清空按钮 |