style: format password
parent
725a7f516f
commit
6893848eb0
|
@ -13,6 +13,7 @@ const ActionMap = {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AInputPassword',
|
name: 'AInputPassword',
|
||||||
|
mixins: [BaseMixin],
|
||||||
model: {
|
model: {
|
||||||
prop: 'value',
|
prop: 'value',
|
||||||
event: 'change.value',
|
event: 'change.value',
|
||||||
|
@ -29,7 +30,6 @@ export default {
|
||||||
visible: false,
|
visible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mixins: [BaseMixin],
|
|
||||||
methods: {
|
methods: {
|
||||||
onChange() {
|
onChange() {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -58,7 +58,14 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { prefixCls, inputPrefixCls, size, suffix, visibilityToggle, ...restProps } = getOptionProps(this);
|
const {
|
||||||
|
prefixCls,
|
||||||
|
inputPrefixCls,
|
||||||
|
size,
|
||||||
|
suffix,
|
||||||
|
visibilityToggle,
|
||||||
|
...restProps
|
||||||
|
} = getOptionProps(this);
|
||||||
const suffixIcon = visibilityToggle && this.getIcon();
|
const suffixIcon = visibilityToggle && this.getIcon();
|
||||||
const inputClassName = classNames(prefixCls, {
|
const inputClassName = classNames(prefixCls, {
|
||||||
[`${prefixCls}-${size}`]: !!size,
|
[`${prefixCls}-${size}`]: !!size,
|
||||||
|
@ -78,14 +85,8 @@ export default {
|
||||||
type: this.visible ? 'text' : 'password',
|
type: this.visible ? 'text' : 'password',
|
||||||
},
|
},
|
||||||
class: inputClassName,
|
class: inputClassName,
|
||||||
on: {
|
on: this.$listeners,
|
||||||
...this.$listeners,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
return (
|
return <Input {...inputProps} />;
|
||||||
<Input
|
|
||||||
{...inputProps}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue